Mkdocs Obsidian
Mkdocs Obsidian is an association between a python script and a Material mkdocs template to get a personal wiki site based on your Obsidian Vault.
You can also use an Obsidian Plugin :
Mkdocs Obsidian is an association between a python script and a Material mkdocs template to get a personal wiki site based on your Obsidian Vault.
You can also use an Obsidian Plugin :
Thanks for writing in details like this. It helps and gives me the motivation to try your setup.
Please teach me if I didnt understand correctly the 2 things as follows.
After having installed mkdocs-material, in order to publish notes I have now 2 options:
Obsidian vault
folder to my folder /docs
located in my repo foldermkdocs-obsidian
to do the task programmatically.In order to make mkdocs-obsidian
work for selective publishing, I need to specify an attribute share: true
in the frontmatter of every notes that I want to publish.
I think you entirely understand!
The share: true
key is when you want to share multiple file. But, if you want to just publish one file, you need to use obs2mk --f "Path/to/the/file"
Thanks for sharing this info this is useful keep it up.
I was just scrolling and found some good information thanks for sharing this amazing post keep posting.
Also, as I create MetaCopy to quickly copy a link from this workflow, here is a little tutorial to use it as I do.
With that, you avoid to edit your source file and you can share a link as notion !
Hello
I added new options, including sharing the entire vault and mobile.
Mobile is intended to be used with IOS shortcuts.
usage: obs2mk [-h] [--git | --mobile] [--meta] [--keep] [--config]
[--force] [--filepath FILEPATH | --ignore]
Create file in docs and relative folder, move image in assets, convert
admonition code_blocks, add links and push.
optional arguments:
-h, --help show this help message and exit
--git, --g, --G No commit and no push to git
--mobile, --shortcuts, --s, --S
Use mobile shortcuts fonction without push.
--meta, --m, --M Update the frontmatter with link
--keep, --k, --K Keep deleted file from vault and removed shared file
--config, --c, --C Edit the config file
--force, --d, --D Force conversion - only work if path not specified
--filepath FILEPATH, --f FILEPATH
Filepath of the file you want to convert
--ignore, --ignore-share, --no-share, --i, --vault
Convert the entire vault without relying on share
state.
Using the command --ignore
will ignore the share
state : you can share your entire vault using that, whatever the state is. By default, it will not overwrite file already exist (and not different), so the --force
option can also be used.
usage: obs2mk [-h] [--git | --mobile] [--meta] [--keep] [--config] [--force] [--ignore]
The mobile option is similar to the git
option but with some nuance. When used to publish a single file, you can use only the file name, without the path.
Be careful though, in case you have several files with the same name, the script will take the first file found.
This option can be used, especially with the “Shortcuts” application on IOS, to share a file directly from the share sheet.
One file usage : obs2mk --mobile --f "filename"
All file usage : obs2mk --mobile
Mobile supports all previous option, including --ignore
.
As I was bored, I updated the script to use Python Rich. So, now you have more information when you share all-share vault !
Hello everyone!
The template now supports tooltip. It’s a fork, waiting for a pull request.
To install it, use pip install git+git://github.com/Mara-Li/mkdocs-tooltipster-links-plugin
I adjust the CSS to be cool with the theme.
If I success to contact the original author of the plugin (who is an Obsidian User !) I think I will use it to, also, add real embed citation in the blog.
After that, I think the blog can be considered as complete.
One day, maybe, it will be a mkdocs plugin and everything will be converted during the build :’).
Okay !
I create a new mkdocs plugin to embed file in mkdocs !
I updated the template + the script to add the support of embed file like in obsidian !
Little question : Do you prefer to have the choice to use a menu, with a little application ? A simple menu to just insert your file, choice the command…
I prefer to use command line (as Obsidian Shell commands change everything for me), but maybe some users prefer to use an app?
Off topic question. How to configure the terminal as yours? Ie. separated color for each folder level
I use Oh my Posh.
Hello everyone ! I updated the readme of this topic with the lasts changes
Thank you for the great work, especially considering the new price of obsidian publish. I have a question: Is there a way to add graph view via obsidian Mkdocs?
Unfortunately not. I already looking for a way to get graph and I don’t found any idea.
There is some limitation I found :
Also, construct an image using graphviz or juggle will broke the script for mobile and it will be not very good (because not responsible and without note link)
So, for the moment, there is no graph view.
Hello !
I updated the script, and reworked all commands.
Global options :
--git
: No commit and push to git ;--mobile
: Use mobile shortcuts instead of --git
--meta
: Update frontmatter of source files--keep
: Don’t delete files in blog folder--shell
: Remove Rich printingCommands and specific options :
--use configuration_name
)
--new configuration_name
: Create a specific configuration for some files--force
: Force updating (ignore the difference between the source and blog file)--vault
: Share all vault file, ignoring the share state.file [file*]
: Share only one fileSecondly, you can now create multiple configuration. For example, you can push two different vault in a different site, or the same vault on a different site. Moreover, with different sharing key, you can push different file to different blog.
obs2mk config --new configuration_name
--use configuration_name
For example : obs2mk --use configuration_name
Hello ! New update.
Now the script will always pull the repo before anything.
The --G
options is active also on that.
In case of pull error, the script will warn you but continue to work !
Hello !
Shiny new things : The script support the new callout / Admonition Microsoft’s Syntax.
It also supports custom callout.
The script support custom admonition. For that, you first need to edit custom_attributes with adding the support, as follow in Admonition’s docs.
For example, to add a dictionnary
admonition:
:root {
--md-admonition-icon--dictionnary: url('data:image/svg+xml;charset=utf-8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 22a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-6v7L9.5 7.5 7 9V2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12z"/></svg>')
}
.md-typeset .admonition.dictionnary,
.md-typeset details.dictionnary {
border-color: rgb(43, 155, 70);
}
.md-typeset .dictionnary > .admonition-title,
.md-typeset .dictionnary > .summary {
background-color: rgba(43, 155, 70, 0.1);
border-color: rgb(43, 155, 70);
}
.md-typeset .dictionnary > .admonition-title::before,
.md-typeset .dictionnary > summary::before {
background-color: rgb(43, 155, 70);
-webkit-mask-image: var(--md-admonition-icon--dictionnary);
mask-image: var(--md-admonition-icon--dictionnary);
It will give you :
The dictionnary
will be recognized, and converted!
PSA for user of obs2mk, I updated the repository : now, template & script will live all together in a “big” repo, where I will store documentation, discussion and issue.
You can continue to copy the template here : GitHub - Mara-Li/mkdocs_obsidian_template: The template for mkdocs-obsidian
BUT the documentation and other will be on this repo.