Organising The Bible in Obsidian

I am close with this CSS running as a css-snippet on the Minimal theme, but I can’t get the spacing between the embedded verses to collapse to zero. The goal is to have two verses embedded on the same line (e.g., ![[Titus 1#1]] ![[Titus 1#2]]) show up as a single embed, with no space between them. Any ideas? The goal is a CSS snippet that accomplishes a display for Minimal (and possibly other themes) like what @Lithou developed here.

.markdown-preview-sizer
{ 
  padding-left: 40px;
  padding-right: 20px;
  nested-padding: 0;
}

.markdown-preview-view h6
{
  position: relative;
  left: -6%;
  top: 23px;
  line-height: 0px;
  margin-top: -18px;
  font-family: var(--font-family-preview);
  font-weight: 500;
  font-size: 10px;
  font-weight: bold;
  color: var(--text-faint) !important;
}

So I want to understand what you are going for here. If I load up minimal theme with your snippets there then this in edit mode:

Yields this in preview mode:

Is the problem just margins being too large? and you want less empty space between the lines? Something like this:

Mostly the issue you are running into is your positioning of the verse headers. You have them as position: relative which allows the you to move it relative to where it would normally be in the flow. That normal spot where it was still exists and takes up space which causes the containers to be taller.
If you use position: absolute, however, the element is removed from the normal flow and no longer affects the positioning or sizes of the other elements.

Here is the snippet I used for the example above. (You can adjust the distance from the top/left to suit your own visual style):

.markdown-preview-view h6 {
  position: absolute;
  left: 5px;
  top: 1px;
  margin: 0px;
}

The other thing to keep in mind is that the first paragraph (<p>) element will have extra margin on the top so setting that to zero will also move things tighter. You can do this with:

.markdown-preview-view .markdown-embed-content p:first-child {
    margin: 0px;
}

You also have your links going across the whole first line. You can change the width and position if you want or you can hide them if you want with a visibility attribute.

div.markdown-embed-link {
    visibility: hidden;
}

Let me know if you have any questions.

2 Likes

So I used @Lithou’s code suggestions and embedded verses now work like a charm.
However, in normal preview mode all verse numbers are now crowded in the upper left corner, as seen below:

I understand that preview-view and embed-view are somehow connected and the issue is due to the absolute position of h6.

If I once again copy in my previous code for preview h6 then the verse numbers in the embed will again be effected.

.markdown-preview-view h6 {
position: relative;
left: -3%;
top: 26px;
line-height: 0px;
margin-top: -20px;
margin-right: 0px;

Any suggestions?
Thanks.

Joe,

This issue has to do with how CSS rules are run.

CSS rules cascade according to specificity. The rule that is more specific will take precedence over one that is less specific. If two rules have the same level of specificity, then the latter one will take precedence.

With the code above it will affect any H6 that is inside a preview-view box. This will apply to anything in preview mode. In order to only apply to H6 elements inside an embed, you will want two rule sets. One less specific that effects all preview H6 elements. Then one more specific that effects all H6 elements inside embedded content.

There is already a general rule in the minimal theme so if you like that then no need to change it. If you want to change it you can create a selector as below:

.markdown-preview-view h6 {
    CSS for all H6 preview elements goes here
 }

Then to make a more specific rule for the embedded H6 elements:

div.markdown-embed .markdown-preview-view h6 {
    position: absolute;
    left: 5px;
    top: 1px;
    margin: 0px;
  }

If you only use this second rule and use minimal theme as your general rule it looks like this:

For reference, here’s the entire snippet:

div.markdown-embed .markdown-preview-view h6 {
    position: absolute;
    left: 5px;
    top: 1px;
    margin: 0px;
  }

.markdown-preview-sizer
{ 
  padding-left: 40px;
  padding-right: 20px;
}

.markdown-preview-view .markdown-embed-content p:first-child {
    margin: 0px;
}

div.markdown-embed-link {
    visibility: hidden;
}
3 Likes

Lithou,
thanks a lot! Now it works :upside_down_face:

Great work, @Lithou and thanks! This works as expected. One final question: what is the selector (and CSS) to slightly adjust the background color of the embed? In light mode, the background should be darkened… It might need to be lightened in dark mode. Any suggestions?

Any clue why the PDF export of embedded verses includes so much spacing before and after? This embed code (displayed in Obsidian using the CSS from your post above):

...passages are included verbatim. The outline is based on Luke's "six books" structure of Acts, showing the progressive completion of the Acts 1:8 mandate:

![[Acts 1#1:8]]

## Context of Acts

exports like this:

Just to add to the conversation with a different, albeit less elegant and organized, method that I’ve decided to use.

I set up a Keyboard Maestro workflow that basically does the following:

  1. I type /ref(space) to add in ![[]] enabling me to type my reference, James 1.12-14 for example. If it has been added already it’ll pop up, if not I continue.
  2. Highlight the link and press the hotkey to run the workflow. The workflow copies the text, creates a new Obsidian page, pastes the text as the note title, replaces the . with a : and adds that as an alias.
  3. the workflow then switches over to Accordance Bible Software and searches for the verse. I highlight and copy the verse and the workflow waits until I shift-tab back to Obsidian. It then pastes the content into the new page. From there I just close out the new page and the reference is shown without flaw.

Like I said, this is much less elegant and I don’t have the entire Bible in my vault, only select verses. However, by leaving Accordance open the entire time I’m doing my study, the process to create a new reference takes all of 7 seconds. I had to tinker a little bit with Accordance, but since I tried multiple ways to even import the Bible in markdown and failed, this turned out to be the easiest, quickest, and most frictionless process for me personally.

P.S. Because the /ref hotkey and the verse-finder hotkey are separate, the verse-finder works even when simply creating a new verse page. I use the same workflow for cross-references in footnotes, only using /foot to insert ^[ ![[]] ] instead of ![[]].

P.S.S. I would not use this workflow if I needed the verses to be organized. I keep all of my references in a “Bible References” folder and there is absolutely no rhyme or reason to their order. However, I’m not reading the Bible through Obsidian, only using Obsidian as a tool for notes, so for me the organization doesn’t matter. I don’t even look in that folder.

Hey, @tward09 I noticed you used Accordance and KBM.

Further up in that thread, I posted two comments about an Applescript I use to capture verse references directly from Accordance using TextExpander. The same could be done using KBM. It didn’t get much attention from folks when I first posted the script but maybe the Applescript might help you in your workflow.

Here are my comments about the Applescript and the workflow I use if you are interested.

https://forum.obsidian.md/t/organising-the-bible-in-obsidian/1490/11?u=mik
https://forum.obsidian.md/t/organising-the-bible-in-obsidian/1490/14?u=mike

Good luck to you!
@Mike

2 Likes

Hey @Mike - I think it was your comment that made me check out Accordance in the first place! I’ll definitely take a look at the scripts. Thanks!

The issue there is that the render puts in several line returns which are normally hidden via CSS. When the export to pdf happens, it adds back in the original space. As the pdf export gets better options, it should resolve the problem.

I use e-sword. I’m wondering if anyone else has had a chance to convert the topx / notex files into something md-like. It’d be cool to have a tie-in to e-sword since it’s so powerful. Even the possibility of importing my old topic notes into Obsidian would make me a happy camper. Of course, I know there’s a million different bible software out there, so doing it just for one would be pointless, but maybe finding a workflow that would support several at one blow would be nice. Then, we could have a list of “suggested software” that could be used. (E-sword is at www.e-sword.net)

1 Like

Yes I too use e-sword and would really like the compatibility.

1 Like

Hey @Thecookiemomma and @gcimmarrusti, sorry, I haven’t used e-sword and therefore have no idea on how to provide compatibility with e-sword.

However, I just shared a Beginner’s Kit to Bible Study in Obsidian that I thought is worth cross-posting. It reflects and expands upon the discussions in this thread and provides a hands-on way to engage practically with Scripture.

1 Like

Hey ! I was trying to do the same although I’m new to Obsidian. Just downloaded it a few days ago. I’m glad I found your comment. Could you tell me how you did that please ? Would help a lot !

1 Like

Hey! I’m new to Obsidian and I’m trying to do something with it with the Quran too. Could you share with me how you did it ? :relaxed:

1 Like

Soon I’ll open a topic about organizing Quran in this forum, if not yet created. Basically, I try to to make each verse has its file, and each word has its own file. I think making it atomic will be easier to analyze and connect, yet it’s cumbersome work.

3 Likes

That would be amazing! Yea, making the files won’t be an easy task but having a tool like this would be really cool. I will be on the lookout for a Quran topic. Can we keep in touch ?

1 Like

Sure, you can also DM me. Feel free to contact me. :slightly_smiling_face:

2 Likes

Hi. I thank you for all your research on getting the Bible in a useable format. I am not a programer and all of the apple script talk is very complicated and difficult for me. I have wasted days on it. I am wondering if I could hire you for some amount to create a ESV or Niv 1984 Bible in the format of my need. I need it to be where every verse has Book Chapter Verse. So it would look like this: Genesis 1:1 In the beginning… Genesis 1:2 The earth was without . . . Genesis 1:3… (This would be each chapter would be one note/page ) This will work great as I am now moving to Craft.do and it has block references and if every verses is listed separately with book and chapter and verse, I can easily find them. Thanks for your consideration… Blessings. (I have tried your Bible Kit with the WEB Bible, in it’s current format it doesn’t work as a block reference.)

1 Like