Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Aligning Text

A topic by Ata Deniz Oktay created Nov 28, 2022 Views: 348 Replies: 6
Viewing posts 1 to 2
(+1)

Hello!

I have been using Deepdwn for a while now to mainly take notes for myself, and I'm really happy that such a tool exists! I haven't used any markdown editor before, so my question here may sound silly.

How do I align text? I have checked the changelogs and the documents of deepdwn but couldn't find a solution. I have tried "div" and "p" tags as it is suggested in different posts throughout the internet so far.

I'm using Deepdwn version 0.37.0 right now.

(1 edit) (+1)

Hi!

So, in general, most flavors of markdown don’t support text alignment or other page layout features. Depending on who you’re talking to, this is one of markdown’s best features: freedom from fiddling with formatting so that you can focus on the important part of writing, which is the actual writing.

Some flavors of markdown support some extended markdown features for alignment. Deepdwn supports centered text with:

-> centered text here <-

(see the example document).

Additionally, some editors (also like Deepdwn) allow HTML content, or a limited set of HTML and HTML attributes for text alignment.

You can add a div text-align style attribute with either left, right, or center:

ex:

<div style="text-align: right">
This will be right aligned
</div>

That lack of universal support is one reason to be careful about the features you make use of, since it will make your documents less portable between editors (or build tools, or preprocessors, or whatever).

You may also find that there are better supported features that you could use instead to get the content structure that you want (like definition lists, or footnotes, or tables, it depends).

Hope that helps!

(3 edits)

Thank you for your reply! It seems like I have used the wrong formatting when it comes to HTML so it did not work. The example you have given works perfectly.

The last thing I need help with is if there is a way to justify text. The alignment styles you have provided work fine, but it seems like I can't justify the text the same way you described.

This is how I have written it in Deepdwn:

<div style="text-align: justify">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Elementum integer enim neque volutpat ac tincidunt vitae. Egestas fringilla phasellus faucibus scelerisque eleifend. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus. 
</div>

This is how it looks in the preview window:


(+1)

Justify isn’t currently supported (as you’ve found), just left/right/center.

I’ll see about adding it in a future release.

Thank you. Looking forward to it!

(+1)

Support for justify text alignment added in v0.38

(+1)

Good to know, thank you for replying again and for letting me know of the update!