Skip to content

Commit 1d91411

Browse files
authored
Initial commit
0 parents  commit 1d91411

15 files changed

+348
-0
lines changed

.github/workflows/ci.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: ci
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- main
7+
permissions:
8+
contents: write
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-python@v4
15+
with:
16+
python-version: 3.x
17+
- uses: actions/cache@v2
18+
with:
19+
key: ${{ github.ref }}
20+
path: .cache
21+
- run: pip install mkdocs-material
22+
- run: pip install mkdocs-roamlinks-plugin
23+
# - run: pip install mkdocs-mermaid2-plugin
24+
- run: mkdocs gh-deploy --force

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.vscode/settings.json
2+
.obsidian/*

2021-11-22-22-49-26.png

32.7 KB
Loading

2021-11-22-22-52-49.png

9.72 KB
Loading

2021-11-22-22-54-02.png

5.11 KB
Loading

LICENSE

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
Creative Commons Legal Code
2+
3+
CC0 1.0 Universal
4+
5+
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6+
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7+
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8+
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9+
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10+
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11+
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12+
HEREUNDER.
13+
14+
Statement of Purpose
15+
16+
The laws of most jurisdictions throughout the world automatically confer
17+
exclusive Copyright and Related Rights (defined below) upon the creator
18+
and subsequent owner(s) (each and all, an "owner") of an original work of
19+
authorship and/or a database (each, a "Work").
20+
21+
Certain owners wish to permanently relinquish those rights to a Work for
22+
the purpose of contributing to a commons of creative, cultural and
23+
scientific works ("Commons") that the public can reliably and without fear
24+
of later claims of infringement build upon, modify, incorporate in other
25+
works, reuse and redistribute as freely as possible in any form whatsoever
26+
and for any purposes, including without limitation commercial purposes.
27+
These owners may contribute to the Commons to promote the ideal of a free
28+
culture and the further production of creative, cultural and scientific
29+
works, or to gain reputation or greater distribution for their Work in
30+
part through the use and efforts of others.
31+
32+
For these and/or other purposes and motivations, and without any
33+
expectation of additional consideration or compensation, the person
34+
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35+
is an owner of Copyright and Related Rights in the Work, voluntarily
36+
elects to apply CC0 to the Work and publicly distribute the Work under its
37+
terms, with knowledge of his or her Copyright and Related Rights in the
38+
Work and the meaning and intended legal effect of CC0 on those rights.
39+
40+
1. Copyright and Related Rights. A Work made available under CC0 may be
41+
protected by copyright and related or neighboring rights ("Copyright and
42+
Related Rights"). Copyright and Related Rights include, but are not
43+
limited to, the following:
44+
45+
i. the right to reproduce, adapt, distribute, perform, display,
46+
communicate, and translate a Work;
47+
ii. moral rights retained by the original author(s) and/or performer(s);
48+
iii. publicity and privacy rights pertaining to a person's image or
49+
likeness depicted in a Work;
50+
iv. rights protecting against unfair competition in regards to a Work,
51+
subject to the limitations in paragraph 4(a), below;
52+
v. rights protecting the extraction, dissemination, use and reuse of data
53+
in a Work;
54+
vi. database rights (such as those arising under Directive 96/9/EC of the
55+
European Parliament and of the Council of 11 March 1996 on the legal
56+
protection of databases, and under any national implementation
57+
thereof, including any amended or successor version of such
58+
directive); and
59+
vii. other similar, equivalent or corresponding rights throughout the
60+
world based on applicable law or treaty, and any national
61+
implementations thereof.
62+
63+
2. Waiver. To the greatest extent permitted by, but not in contravention
64+
of, applicable law, Affirmer hereby overtly, fully, permanently,
65+
irrevocably and unconditionally waives, abandons, and surrenders all of
66+
Affirmer's Copyright and Related Rights and associated claims and causes
67+
of action, whether now known or unknown (including existing as well as
68+
future claims and causes of action), in the Work (i) in all territories
69+
worldwide, (ii) for the maximum duration provided by applicable law or
70+
treaty (including future time extensions), (iii) in any current or future
71+
medium and for any number of copies, and (iv) for any purpose whatsoever,
72+
including without limitation commercial, advertising or promotional
73+
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
74+
member of the public at large and to the detriment of Affirmer's heirs and
75+
successors, fully intending that such Waiver shall not be subject to
76+
revocation, rescission, cancellation, termination, or any other legal or
77+
equitable action to disrupt the quiet enjoyment of the Work by the public
78+
as contemplated by Affirmer's express Statement of Purpose.
79+
80+
3. Public License Fallback. Should any part of the Waiver for any reason
81+
be judged legally invalid or ineffective under applicable law, then the
82+
Waiver shall be preserved to the maximum extent permitted taking into
83+
account Affirmer's express Statement of Purpose. In addition, to the
84+
extent the Waiver is so judged Affirmer hereby grants to each affected
85+
person a royalty-free, non transferable, non sublicensable, non exclusive,
86+
irrevocable and unconditional license to exercise Affirmer's Copyright and
87+
Related Rights in the Work (i) in all territories worldwide, (ii) for the
88+
maximum duration provided by applicable law or treaty (including future
89+
time extensions), (iii) in any current or future medium and for any number
90+
of copies, and (iv) for any purpose whatsoever, including without
91+
limitation commercial, advertising or promotional purposes (the
92+
"License"). The License shall be deemed effective as of the date CC0 was
93+
applied by Affirmer to the Work. Should any part of the License for any
94+
reason be judged legally invalid or ineffective under applicable law, such
95+
partial invalidity or ineffectiveness shall not invalidate the remainder
96+
of the License, and in such case Affirmer hereby affirms that he or she
97+
will not (i) exercise any of his or her remaining Copyright and Related
98+
Rights in the Work or (ii) assert any associated claims and causes of
99+
action with respect to the Work, in either case contrary to Affirmer's
100+
express Statement of Purpose.
101+
102+
4. Limitations and Disclaimers.
103+
104+
a. No trademark or patent rights held by Affirmer are waived, abandoned,
105+
surrendered, licensed or otherwise affected by this document.
106+
b. Affirmer offers the Work as-is and makes no representations or
107+
warranties of any kind concerning the Work, express, implied,
108+
statutory or otherwise, including without limitation warranties of
109+
title, merchantability, fitness for a particular purpose, non
110+
infringement, or the absence of latent or other defects, accuracy, or
111+
the present or absence of errors, whether or not discoverable, all to
112+
the greatest extent permissible under applicable law.
113+
c. Affirmer disclaims responsibility for clearing rights of other persons
114+
that may apply to the Work or any use thereof, including without
115+
limitation any person's Copyright and Related Rights in the Work.
116+
Further, Affirmer disclaims responsibility for obtaining any necessary
117+
consents, permissions or other rights required for any use of the
118+
Work.
119+
d. Affirmer understands and acknowledges that Creative Commons is not a
120+
party to this document and has no duty or obligation with respect to
121+
this CC0 or use of the Work.

README.md

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Publish your Obsidian Notes
2+
3+
(MkDocs template)
4+
5+
Would you like to take _some_ of your notes in [Obsidian](https://obsidian.md/) and make it public?
6+
7+
This template gives you an easy (and automated) way to publish your Obsidian notes on your Github pages.
8+
9+
With this template, you get these **out-of-the-box**:
10+
11+
- an awesome website based on Material theme, complete with a search bar (Checkout this template repo published [here](https://jobindjohn.github.io/obsidian-publish-mkdocs/))
12+
![](2021-11-22-22-49-26.png)
13+
- get the Obsidian/Roam style `[[wikilinks]]` from your vault in your published notes
14+
- Toggle between light and dark mode
15+
16+
## Quick start
17+
18+
1. Create a **new github repository using this template**. Click the green button at the top or use [this link](https://github.com/jobindjohn/obsidian-publish-mkdocs/generate).
19+
20+
![](2021-11-22-22-54-02.png)
21+
22+
2. **Give a name** to your repository. By default your notes will be published at `<https://username.github.io/repo-name/>`
23+
- Copy only the `main` branch while creating the repo from the template
24+
3. **Clone** the repository you generated **into your Obsidian folder/vault.**
25+
4. **Move your notes** that you would like to make public to the `repo-name/docs` folder.
26+
- Easiest way to do this would be using drag and drop within Obsidian
27+
5. Commit and **push** the changes. Github actions will take care of the rest, publishing your notes using [MkDocs](https://www.mkdocs.org/), with the [Material theme](https://squidfunk.github.io/mkdocs-material/).
28+
6. Go to `Settings > Pages` and select the select the **Source** as your `gh-pages` branch.
29+
30+
![](2021-11-22-22-52-49.png)
31+
32+
**Not working for you?** Open an [issue](https://github.com/jobindjohn/obsidian-publish-mkdocs/issues/new/choose) and let me know what went wrong.
33+
34+
## Configuring your website
35+
36+
### How do I arrange notes as sections and pages?
37+
38+
By default, the sections and pages will follow the folder structure within `/docs`. The folders and sub-folders will show up as sections. Try not to have white spaces in your folder and file names, as these will be converted to HTML links. The webpage heading will be the same as the first-level heading in the markdown note.
39+
40+
- If you would like to arrange the pages manually, then use the `nav` option in the `mkdocs.yml` [configuration file](https://www.mkdocs.org/#adding-pages) at the root of this repo to set custom page navigation.
41+
- For example, see the setup for [the Blue Book](https://lyz-code.github.io/blue-book/) at [github](https://github.com/lyz-code/blue-book/blob/master/mkdocs.yml). Managing each page using `nav` can become cumbersome as the number of notes increase though!
42+
- The Materials theme provides multiple options to arrange [sections](https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#navigation-sections), use [navigation tabs](https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#navigation-tabs), and many other helpful [navigation setups](https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/)
43+
44+
## Alternatives
45+
46+
- [datopian/obsidian-flowershow](https://github.com/datopian/obsidian-flowershow): plugin for publishing with flowershow direct from your obsidian vault.
47+
- [kmaasrud/oboe](https://github.com/kmaasrud/oboe): tool to convert an Obsidian vault into a static directory of HTML files.
48+
- [Jackiexiao/foam-mkdocs-template](https://github.com/Jackiexiao/foam-mkdocs-template): template for Obsidian/Foam using mkdocs/mkdocs-material/mkdocs-roamlinks-plugin
49+
- [foambubble/foam-template](https://github.com/foambubble/foam-template): Foam workpace template
50+
- [ObsidianPublisher/obsidian-mkdocs-publisher-template](https://github.com/ObsidianPublisher/obsidian-mkdocs-publisher-template): Obsidian Mkdocs Publisher, a free obsidian publish alternative throught Mkdocs
51+
- [KosmosisDire/obsidian-webpage-export](https://github.com/KosmosisDire/obsidian-webpage-export): Webpage HTML Export lets you export single files or whole vaults as HTML websites or documents. It is similar to publish, but you get direct access to the exported HTML.
52+
53+
## Other interesting projects
54+
55+
- [mathieudutour/gatsby-digital-garden: digital garden with Gatsby](https://github.com/mathieudutour/gatsby-digital-garden)
56+
- [TuanManhCao/digital-garden: Free Obisidian Publish alternative](https://github.com/TuanManhCao/digital-garden)
57+

docs/Features/LaTeX Math Support.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# LaTeX Math Support
2+
3+
LaTeX math is supported using MathJax.
4+
5+
Inline math looks like $f(x) = x^2$. The input for this is `$f(x) = x^2$`. Use `$...$`.
6+
7+
For a block of math, use `$$...$$` on separate lines
8+
9+
```
10+
$$
11+
F(x) = \int^a_b \frac{1}{2}x^4
12+
$$
13+
```
14+
15+
gives
16+
17+
$$
18+
F(x) = \int^a_b \frac{1}{2}x^4
19+
$$

docs/Features/Mermaid Diagrams.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Mermaid diagrams
2+
3+
Here's the example from [MkDocs Material documentation](https://squidfunk.github.io/mkdocs-material/reference/diagrams/#using-flowcharts):
4+
5+
```mermaid
6+
graph LR
7+
A[Start] --> B{Error?};
8+
B -->|Yes| C[Hmm...];
9+
C --> D[Debug];
10+
D --> B;
11+
B ---->|No| E[Yay!];
12+
```
13+
14+

docs/Features/Text Formatting.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Text Formatting
2+
3+
You can have lists like this
4+
5+
- first
6+
- second
7+
- third
8+
9+
Or checklist lists to
10+
11+
- [ ] ==Get==
12+
- [ ] things
13+
- [ ] ~~done~~
14+
15+
Also, get highlights and strikethroughs as above (similar to Obsidian).
16+
17+
18+
More formatting options for your webpage [here](https://squidfunk.github.io/mkdocs-material/reference/formatting/#highlighting-changes). (but not compatible with Obsidian)

docs/Topic 1/Note 1.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Note 1
2+
3+
Example: link to [[Mermaid Diagrams]] under `Features`

docs/Topic 1/Note 2.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Note 2
2+

docs/index.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Obsidian Notes
2+
3+
Publish your public notes with MkDocs
4+
5+
## Hello World!
6+
7+
The `index.md` in the `/docs` folder is the homepage you see here.
8+
9+
The folders in `/docs` appear as the main sections on the navigation bar.
10+
11+
The notes appear as pages within these sections. For example, [[Note 1]] in `Topic 1`

docs/javascripts/mathjax.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
window.MathJax = {
2+
tex: {
3+
inlineMath: [["\\(", "\\)"]],
4+
displayMath: [["\\[", "\\]"]],
5+
processEscapes: true,
6+
processEnvironments: true
7+
},
8+
options: {
9+
ignoreHtmlClass: ".*|",
10+
processHtmlClass: "arithmatex"
11+
}
12+
};
13+
14+
document$.subscribe(() => {
15+
MathJax.typesetPromise()
16+
})
17+

mkdocs.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
site_name: obsidian-mkdocs template
2+
3+
theme:
4+
name: 'material'
5+
palette:
6+
7+
# Light mode
8+
- media: "(prefers-color-scheme: light)"
9+
scheme: default
10+
primary: pink
11+
accent: indigo
12+
toggle:
13+
icon: material/toggle-switch-off-outline
14+
name: Switch to dark mode
15+
16+
# Dark mode
17+
- media: "(prefers-color-scheme: dark)"
18+
scheme: slate
19+
primary: pink
20+
accent: blue
21+
toggle:
22+
icon: material/toggle-switch
23+
name: Switch to light mode
24+
25+
# Extensions
26+
markdown_extensions:
27+
- footnotes
28+
# - attr_list
29+
- pymdownx.arithmatex:
30+
generic: true
31+
# - pymdownx.superfences
32+
# - pymdownx.details
33+
# - pymdownx.magiclink
34+
- pymdownx.tasklist:
35+
custom_checkbox: true
36+
- def_list
37+
- pymdownx.critic
38+
- pymdownx.caret
39+
- pymdownx.keys
40+
- pymdownx.mark
41+
- pymdownx.tilde
42+
- pymdownx.superfences:
43+
custom_fences:
44+
- name: mermaid
45+
class: mermaid
46+
format: !!python/name:pymdownx.superfences.fence_code_format
47+
48+
- toc:
49+
permalink: true
50+
51+
plugins:
52+
- search
53+
- roamlinks
54+
55+
56+
extra_javascript:
57+
- javascripts/mathjax.js
58+
- https://polyfill.io/v3/polyfill.min.js?features=es6
59+
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
60+
- https://unpkg.com/mermaid/dist/mermaid.min.js

0 commit comments

Comments
 (0)