Organising The Bible in Obsidian

Hi s0ph0s,

May I ask how to edit the output produced by the macro such that the format matches the naming of my obsidian files for each chapter?

For example, my file for 1 Corinthians 12 is titled

[[1 Cor-12]] rather than [[1 Corinthians 12]].

Other than that the macro works PERFECTLY! I’d edit it myself but I suspect the bottleneck here is my knowledge of RegEx!

I think this RegEx will do what you need:

(\d*\s*[a-zA-Z]*\-*\d{0,3})[:|.](\d*\-*\d*)

Just copy and paste that over what’s in the macro. :wink:

And I know what you mean about RegEx mastery. The good news is it’s a journey, not a destination.

1 Like

Wow! Just discovered this treasure trove of a thread.

It would be so helpful if someone at some point compiled a guide of how to setup all the techniques discussed in this thread to make a Bible Study (or other large text study) vault.

4 Likes

Since block referencing is a thing now, how would it change the way we reference to Bible verses? I can see another version of @Joschua’s script that would utilize block referencing instead of headers (though I’m not begging @Joschua to make another one, I’m not willing to change my set-up either lol).

The way I see it, using headers (the way Script 2.0 formats it) makes it easier for linking specific verse & chapter numbers i.e. [[John. 3#16]] whereas the global block referencing is better for searching specific keywords from a verse in mind, albeit the output of that isn’t quite as elegant unless you decide to use pipes for custom text, which is extra work. It still doesn’t fix the problem of wanting to link multiple verses since you would need to block ref every individual verse just like you would with headers (correct me if I’m wrong though, haven’t got the latest update so I haven’t really tried the feature out).

PS: Don’t know why the word “block” is highlighted lol

Talking about The Bible…
This approach is of course also a possibility :wink:


Came up in one of the RSS-feeds in my Obsidian workflow today
1 Like

So I have changed my approach to organization slightly. I’m still using one file per chapter and using headers to subdivide chapters. The difference is now I’m using the headers to divide by paragraph instead of by verse. I’m also using headings for sections (usually listed as sub-titles). H2 is used for sections while H3 is used for paragraphs so the outline functionality will be useful for longer chapters.


Here’s an example. Note there is a 5th paragraph that is cut off:


This structure allows me to reference a chapter (Romans 4) a whole section (Abraham Justified…) or a paragraph (P3). It also allows me to do a block ref by typing in a section of the Text. (Autocomplete is shown below):


When Referenced, the headers provide a listing of the chapter and verses contained where the block reference does not. The edit mode is on top, preview of the same section is below:

Edit: formatting to make things easier to read.

4 Likes

Wow thank you for sharing this! I’m newer to the program, and this thread has been pretty intimidating to me because of all the complex work arounds I’ve seen discussed here. But Because of block referencing, you’re method makes so much more sense to me! This could really help me. I think I’d prefere leaving the verse numbers among the scriptures for me personally, but this is great! I’m going to try and adopt this and see how it works for me! Thanks for sharing!

1 Like

How hard would it be to turn this CSS snippet into a plugin that works across all themes:

.markdown-embed-content h6{
  position: absolute;
  font-size: small;
  right: 101%;
  margin-top: 3px;
}

I am having no luck tweaking it for use with Minimal Theme. If someone would be willing to write the complete CSS needed to override a theme’s styling of transclusions, it could either be pasted at the end of any obsidian.css or included in a separate stylesheet in a forthcoming release of Obsidian. Any ideas how to address this?

1 Like

It’s probably just conflicting with something else in the theme. I can take a look and help you out, but it will most likely have to wait until after this week. We’re working crazy overtime at work and I’ve got an chemistry exam due by Friday. Next week though I’m on holiday starting Wednesday. I can go through the theme and show you how it works too if you are interested in learning.

2 Likes

That would be great! Once I can get the CSS working I will be able to transfer all of my scattered studies into one place.

+1
I also ran into the same issue. I’ve been using the “Bear”-Theme for a while but the Minimal Theme just looks better for me and is more distraction free.
I already tried to tweak the css settings to get the verse numbers aligned but until now without success.

In case it’s useful to anyone else, here is my substitution command for converting a “regular Scripture reference” to a wiki link Scripture reference using vim:

:%s/\v( ?[1-3]? [A-Z][a-z]*) ([0-9][0-9]?[0-9]?:[0-9][0-9]?-?[0-9]?[0-9]?)/ [[\1#\2]]/g

The above will sometimes leave an extra space after the opening [[ so then I run this to remove that:

:%s/\[\[ /[[/g

I typically run this while editing multiple files, something like vim notes/*.md and then use bufdo to run the substitutions on all the files at once and save to disk.

:bufdo execute '%s/\v( ?[1-3]? [A-Z][a-z]*) ([0-9][0-9]?[0-9]?:[0-9][0-9]?-?[0-9]?[0-9]?)/ [[\1#\2]]/g' | update

and then:

:bufdo execute ':%s/\[\[ /[[/g' | update

For reference, the above turns text like this:

Paul refers to Genesis 15:6 in Galatians 3:6.

1 John 4:5 and 2 Chronicles 7:11 and also Psalm 119:9-11

into text like this:

Paul refers to [[Genesis#15:6]] in [[Galatians#3:6]].

[[1 John#4:5]] and [[2 Chronicles#7:11]] and also [[Psalm#119:9-11]].

Of course, if you use a similar reference syntax for anything else the above commands will convert them as well. It does not convert Galatians 4 or Galatians.

To round out the setup I have, I’m using 1 file per book for Scripture, like this:

Ephesians

Chapter 1

Paul Addresses The Ephesians
1:1

Paul, an apostle of Christ Jesus by the will of God,
To the saints who are in Ephesus, and are faithful in Christ Jesus:

1:2

Grace to you and peace from God our Father and the Lord Jesus Christ.

Overall, this is really suiting my use case, which is mostly speaking notes with references into my mobile app while studying Scripture. These are pushed into a private Github repository which Obsidian then pulls down on startup. I think the next step for me is to automate the reference conversion, maybe via a git hook on my repository so that the references get linkified before a commit.

2 Likes

Nice work! Any chance of turning that into a plug-in that us mere mortals could execute by setting up a hot key for it?

2 Likes

I see in 0.9.18 that CSS snippets are going to be officially supported. That seems like it would be an ideal way to set up the override for any theme. What do you think?

Here is at least a one line script you could run on the command line, only tested on a Mac:

gsed -i -e 's/\([1-3]\? \?[A-Z][a-z]*\) \([0-9][0-9]\?[0-9]\?:[0-9][0-9]\?-\?[0-9]\?[0-9]\?\)/ \[\[\1#\2\]\]/g' -e 's/\[\[ /\[\[/g' *.md

That will run the substitution on any file ended in .md in the current working directory.

1 Like

I went ahead and created a pre-commit script that I thought I’d share in case anyone else is using git for their Obsidian vault and wants to try it out. The script is more complicated now but also more precise since I’m explicitly listing the full name of each book. I also updated it to work for chapter only references, like “Genesis 12”.

I uploaded the file as a gist here: https://gist.github.com/jag3773/5797912d1fc6616e55af88a6d10c6d41

Note that you’ll need to download that file to the .git/hooks/ directory in your vault’s git repository and make sure it is executable. Once in place it will run every time you do a commit in your repo.

I’m using the Obsidian Git plugin which I have set to auto commit every 2 minutes and this seems to be working well.

1 Like

I thought I’d share the method I’ve been using for Bible Notes. I use @Lithou 's method for having one note per chapter and then headings for paragraphs and I’ve loved that! The thing I added to it, is I tag each paragraph with the themes I recognize to better help me find verses in the future when I’m writing my sermons or study notes on topics. I also tend to just paste the whole chapter from biblestudytools.com and then format it, instead of using a script that’s above my technical level.

5 Likes

Thank @Lithou and @Chaulk5 for sharing your approaches. I am amazed by the responses in this whole thread.

To make it easy to find different approaches and snippets for newcomers, I’ll edit the first post into a summary. → Summary here!
For reference, I’ll repost my original first post here though:

First Post

I just finished writing a script to import the Bible into Obsidian.

Before I start importing over 700 000 words into Obsidian, I am thinking about how to organise this book. The Bible is structured in Books, Chapters, Verses. My initial thought is to create a Note for each book with a ## Heading for each Chapter and a ### Header for each verse.
That makes referencing and embedding possible without cluttering the graph in an excessive way.

I would be interested to hear thoughts on how to organise this amount of information while being able to easily embed, read and backlink to it.


An example note containing a book of the Bible:

A verse embedded:

3 Likes

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