More types of horizontal rule


Use case or problem

When I make a draft of separation of parts of a note by the horizontal rule instead of headings, I sometimes want more of the types of that horizontal rule, because in the end I start to see that the one topic elaborates another, like sub-header for header.

If in the sub-header I can just make the # doubled to show that the previous topic continues, with the horizontal rules as drafts for the future heading I can do nothing. I don’t want to make it seem like the absolutely new part and no other type of the horizontal rule is present to do so.

Proposed solution

Make dotted horizontal rules, curly horizontal rules or any other types to make some distinction between the horizontal rules.

Current workaround

I make just … instead of — to make it seem like you made the dotted horizontal rule between two chapters of note. Doesn’t look as beautiful as the line going to the edge of the note, but whatever solves the issue somehow.

Also sometimes I just make the part separation by putting the # and ## without the names for the chapters. Horizontal rules are just for formatting in the end, no real meaning right now…

1 Like

In modern HTML, the <hr /> tag has been redefined from “horizontal rule” to “thematic break” — which is how you’re using them — but they have no hierarchy. So I think what you’re asking for is unlikely to become a feature.

Here are a couple more workarounds:

  • If you only need them to differ in source view, Markdown allows you to use different symbols. I think you can use almost any symbol but I might be wrong — I know you can use hyphens and asterisks, and put spaces between them, if you like (---, ***, - - -, * * *). They all render the same way, tho.

  • You could use HTML instead of Markdown, and assign classes: <hr class="level2">, then use CSS snippets to render each class differently. This is more typing if you do it manually, but you could assign a hotkey or template, or use third-party text expansion (if you use MacOS, it has a text expansion feature built in).

Here’s a modified feature request/plugin idea: have Obsidian assign different classes to hrs depending on what symbol was used to type them. Then you could use CSS snippets (or a hypothetical plugin) to style them differently.

But since you want hierarchy, I think your use of empty headings makes the most sense. I use headings that contain only comments (which makes the headings empty since there’s no “actual” content) for a similar purpose:

## 3. <!--Lord von Hintern explains the curse-->
1 Like

Thanks for reply!

Exactly what I wanted to say: plugin or CSS to render horizontal rules differently depending on what I typed. I mean render “- - -”, " * * * ", “***” as different types of horizontal rule.

Yes, I want, but I don’t actually need it to be read by computer as a hierarchy. My idea was that foremost a writer reads the different types of horizontal rules as hierarchy, not mainly a computer.

I think the headings are clearer for humans because number of hashes indicates the level. Then again, you could do the same with hrs — you’re allowed to use more than 3 of the symbol (---, ----, and ------ are all valid). But that doesn’t help with the rendering.

I don’t think you can use CSS to accomplish your goal, because that applies to the rendered HTML, and no matter how you write the Markdown it always renders the same. I imagine a plugin could probably do it. Without a plugin, the only way I know to get the rendered result you want is to use HTML as I suggested.

1 Like

I recently found out that there is a horizontal rule as alternative header implementation:

When --- added – the text above it now is a # type of markdown header.

Just in the way way as you you said: I made --- into ---- with expectation that # header is now a ## subheader. Buuut…

Exactly the point! Horizontal rule renders all the same and ---- is not seen by PC as a subheader done with the logic of # headers when # hashtag is doubled. I mean ---- is still the # 1st header in any mode and of the same look of the exact exactly the same line as any other line like that:

As for elaboration of your idea:
Would be nice if the ---- will be rendered as double line (or any other type of line) in the life preview mode and reading mode and ---- will be giving the ## subheader type of text format to the text above it. Humans can read, computer can read. All is nice! It is even already partly implemented!!

I think that they only have to make that logic go on as ----- header is ### 3rd level header. Or *** is ### 3rd level of header because ----- is too long. Just need settings for customization of it to change the defaults.

I would suggest the core plugin implemented with the options to change the render, the horizontal rules, toggles. Or thing itself already made with the Obsidian setting. Here are some guesses of those settings:

  1. toggle to render the --- below the # header as this line below

    or leave it unconverted as it does right now.
    --- didn’t convert to the line. This is the default option to be changed to make it convert into the line below the headers.

  2. Made customization of the all types of horizontal rules and possible settings for all of them made for each one individually.
    2.1. Toggle on or off the # header creation when the text added to the top. So the --- wouldn’t make the text above --- as # header. Made for certain types of custom horizontal rules or toggled globally.
    2.2. Change the text rendered by PC as a horizontal rule, choose the types of texts making the custom horizontal rule. Why not make the horizontal rule of % % % or %%% or ^^^ or any other symbol and make the unique settings for single one of them? Why not make the combination of the *-*-* as a possible horizontal rule? Shortcuts for them to insert?
    2.2.1. Assign to all those customized types of horizontal rule the own texture. The possible customization of horizontal rule render setting so that *** can be rendered as anything you like: like double line, curvy, triple line. Anything if the custom types are implemented to be added.
    2.2.2. There is a whole opportunity for Obsidian options to make the custom horizontal rules for dedicated purpose.
    Something similar is in the Encore theme GitHub - Maldonacho/obsidian-encore-theme: The Encore theme aims to freshen up the UI of with modern design, loosely based off Material 3.

    Instead Obsidian logo there can be callout fashion signs for example the info callout
    Imagine the (i) Info instead of the Obsidian logo in the center of the horizontal rules, a possibility to Insert some picture of callout markdown in the mid of a horizontal rule, the command to add horizontal rules with >[!INFO] >[IMPORTANT] >[!HINT] signs in the center, the assignments of look of those types of horizontal rule to the custom horizontal rules already created. It is much better than # header markdown for titles already!

The problem with Obsidian now is the implementation of headings by the horizontal rule is here, but not full in own distinct fashion new to the headings. I think that HTML is somehow the solution for now, but not as comfortable when developers implement that on the software level. Obsidian team surely can do more to horizontal rules in new updates. Just such a big thing to miss to implement when the process is already started

Just throwing out another potential workaround: Use a custom SVG, and use a snippet manager to add it.

It will scale without pixelation, and you can design whatever you like, including fancy decorative shapes.