Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate user guide/examples to mkdocs #470

Merged
merged 87 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 78 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
13ff0ae
Convert latex user guide to markdown
qiaojunfeng Feb 13, 2024
d8f5395
Update
qiaojunfeng Feb 13, 2024
047f32a
Switch to mathjax
qiaojunfeng Feb 13, 2024
7e95ef8
Add macro for `bm`
qiaojunfeng Feb 13, 2024
7390d5c
Use gfm flavor tables
qiaojunfeng Feb 13, 2024
b7d0585
Fix projections
qiaojunfeng Feb 13, 2024
4e17398
Fix projections
qiaojunfeng Feb 13, 2024
82e8910
Fix lib mode
qiaojunfeng Feb 13, 2024
f6accf4
Add overview.webp
qiaojunfeng Feb 13, 2024
2968dc2
Fix markdown files for postw90 and appendices (#1)
jiang-yuha0 Feb 13, 2024
df40bb0
Fix markdown file (#2)
jiang-yuha0 Feb 13, 2024
797f9f4
Fix transport
qiaojunfeng Feb 13, 2024
136057e
Fix files
qiaojunfeng Feb 13, 2024
027125d
Firt five tutorials for online version
Feb 14, 2024
7a7b89b
Fix markdown file for parameters chapter (#3)
npaulish Feb 14, 2024
3fbd067
17 tutorials for online version
Feb 14, 2024
aaba067
Add Section postw90/parameters
jiang-yuha0 Feb 14, 2024
7eb04b2
Fix tables in postw90/parameters.md file
npaulish Feb 14, 2024
8ebeb89
Update some links
jiang-yuha0 Feb 14, 2024
01987ae
24 tutorials for online version
Feb 14, 2024
f257c50
Added tutorial.md
Feb 14, 2024
74de353
Check the format of markdown files.
jiang-yuha0 Feb 14, 2024
3078e54
29 tutorials for online version
Feb 14, 2024
5f71b15
Fixing rendering of equations in t18 e t27
Feb 14, 2024
b8883a4
Remove absolute number in cross-file equation ref
jiang-yuha0 Feb 15, 2024
5cf2ccf
Add Section postw90/parameters
jiang-yuha0 Feb 14, 2024
dfd1daa
Fix tables in postw90/parameters.md file
npaulish Feb 14, 2024
836d7f4
Update some links
jiang-yuha0 Feb 14, 2024
77a4977
Check the format of markdown files.
jiang-yuha0 Feb 14, 2024
b6c7c44
Remove absolute number in cross-file equation ref
jiang-yuha0 Feb 15, 2024
abaf991
Merge branch 'mkdocs' of github.com:qiaojunfeng/wannier90 into mkdocs
jiang-yuha0 Feb 15, 2024
b7ca9cf
Up to tutorial 30 with all figures
Feb 15, 2024
f68d31e
Remove more absolute numbers
jiang-yuha0 Feb 15, 2024
23d3b85
Fix the figure label
jiang-yuha0 Feb 15, 2024
77ba15e
Up to tutorial 31 with all figures and bugfix
Feb 15, 2024
270cb92
solving conflicts in mkdocs.yml
Feb 15, 2024
b6eaf80
solving conflicts in mkdocs.yml
Feb 15, 2024
2dc33ca
Fix tutorials 32 and 33
npaulish Feb 15, 2024
ea4dbf2
Fix figures in Tutorials 32 and 33
npaulish Feb 15, 2024
721dad2
Fix figure captions in Tutorials 32 and 33
npaulish Feb 15, 2024
2dea9c3
Minor fixes in Tutorials 32 and 33
npaulish Feb 15, 2024
522da11
Add custom css
qiaojunfeng Feb 15, 2024
4d4f220
Merge tutorials
qiaojunfeng Feb 15, 2024
bc3be71
Firt five tutorials for online version
Feb 14, 2024
360af64
17 tutorials for online version
Feb 14, 2024
ca844ed
24 tutorials for online version
Feb 14, 2024
0ff1863
Added tutorial.md
Feb 14, 2024
772753a
29 tutorials for online version
Feb 14, 2024
084ab06
Fixing rendering of equations in t18 e t27
Feb 14, 2024
e263258
Up to tutorial 30 with all figures
Feb 15, 2024
ed12ac0
Up to tutorial 31 with all figures and bugfix
Feb 15, 2024
2418c8b
solving conflicts in mkdocs.yml
Feb 15, 2024
0cd4017
Fix tutorials 32 and 33
npaulish Feb 15, 2024
c83296b
Fix figures in Tutorials 32 and 33
npaulish Feb 15, 2024
261f917
Fix figure captions in Tutorials 32 and 33
npaulish Feb 15, 2024
41bf59b
Minor fixes in Tutorials 32 and 33
npaulish Feb 15, 2024
fffb333
Add custom css
qiaojunfeng Feb 15, 2024
e26720b
Merge tutorials
qiaojunfeng Feb 15, 2024
de77048
Fix the figure label
jiang-yuha0 Feb 15, 2024
3a5fa2c
Add link from user_guide to tutorial
jiang-yuha0 Feb 15, 2024
7b28553
Fix link
jiang-yuha0 Feb 15, 2024
f88ef6a
Fixing corss-references in the tutorials
Feb 15, 2024
a625afe
Fix caption in Tutorial 8
jiang-yuha0 Feb 15, 2024
2130831
Fixing corss-references in the tutorials
Feb 15, 2024
22e3919
Merge branch 'mkdocs_merge' into mkdocs_merge
qiaojunfeng Feb 15, 2024
c2468f2
Merge pull request #6 from VVitale/mkdocs_merge
qiaojunfeng Feb 15, 2024
0723cd4
Fix figcaption latex
qiaojunfeng Feb 15, 2024
ee9acd2
Changing all examples into tutorials, creating a markedown README and…
Feb 15, 2024
b02af31
Fix links
jiang-yuha0 Feb 15, 2024
27452fc
Fixing typos in Tutorial 17 and Tutorial 8
Feb 15, 2024
4af6254
Added logos folder into the docs
Feb 15, 2024
0a4717f
Set logo
qiaojunfeng Feb 15, 2024
ac55316
Minor fixes in the docs
npaulish Feb 15, 2024
d0f8b00
Merge remote-tracking branch 'upstream/develop' into mkdocs
qiaojunfeng Feb 15, 2024
48b76b4
Cleanup mkdocs yaml
qiaojunfeng Feb 15, 2024
7cf33db
Fix precommit hook for mkdocs.yml
qiaojunfeng Feb 16, 2024
dfdb98c
Add github workflow for mkdocs
qiaojunfeng Feb 16, 2024
743c0d4
Add CI for docs test
qiaojunfeng Feb 16, 2024
d451940
Removing old latex and PDF
giovannipizzi Feb 16, 2024
aa220a3
Fix md links
qiaojunfeng Feb 16, 2024
2bf895b
Enable strict mode of mkdocs
qiaojunfeng Feb 16, 2024
1566bdf
Update docs home
qiaojunfeng Feb 16, 2024
669a346
fixing link to equation in tutorial 29
Feb 16, 2024
4a5902a
Fixing paths to the correct tutorial folder on the github repo in the…
Feb 16, 2024
2767a46
Change docs color
qiaojunfeng Feb 16, 2024
97fc484
Use GITHUB_TOKEN
qiaojunfeng Feb 16, 2024
89a9a7c
Merge remote-tracking branch 'upstream/develop' into mkdocs
qiaojunfeng Feb 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 25 additions & 0 deletions .github/workflows/docs_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI test docs
on:
pull_request:
paths:
- docs/**

jobs:
docs:
name: Build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-w90-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-w90-
- run: pip install -r docs/requirements.txt
- run: mkdocs build
working-directory: ./docs
18 changes: 18 additions & 0 deletions .github/workflows/docs_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish docs via GitHub Pages
on:
push:
branches:
- master

jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Deploy docs
uses: mhausenblas/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ repos:
rev: v4.1.0
hooks:
- id: check-yaml
exclude: (?x)^(
docs/mkdocs.yml
)$
- id: check-yaml
name: check yaml unsafe
args: ['--unsafe']
files: (?x)^(
docs/mkdocs.yml
)$
- id: trailing-whitespace
files: (?x)^(
config/make[.]inc[.\w]*|
Expand Down
160 changes: 160 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
31 changes: 31 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Wannier90 documentation

Wannier90 documentation using `mkdocs`.

## Project layout

mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.

## Installation

```bash
pip install -r requirements.txt
```

## Commands

* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs -h` - Print help message and exit.

## Notes on conversion

The original wannier90 latex documentation was converted to markdown using `pandoc`. The resulting markdown files were then manually edited to fit the `mkdocs` format.

```bash
pandoc -s wannier90/doc/user_guide/user_guide.tex -o user_guide.md
```
1 change: 1 addition & 0 deletions docs/docs/assets/wannier-logo-squared.png
1 change: 1 addition & 0 deletions docs/docs/assets/wannier-logo-squared.svg
6 changes: 6 additions & 0 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Welcome to Wannier90 documentation

This is the home of maximally-localised Wannier functions (MLWFs) and Wannier90, the computer program that calculates them.

- [User guide](user_guide/introduction)
- [Tutorials](tutorials/preliminaries)
10 changes: 10 additions & 0 deletions docs/docs/javascripts/katex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
document$.subscribe(({ body }) => {
renderMathInElement(body, {
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "$", right: "$", display: false },
{ left: "\\(", right: "\\)", display: false },
{ left: "\\[", right: "\\]", display: true }
],
})
})
23 changes: 23 additions & 0 deletions docs/docs/javascripts/mathjax.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
window.MathJax = {
tex: {
inlineMath: [["\\(", "\\)"]],
displayMath: [["\\[", "\\]"]],
processEscapes: true,
processEnvironments: true,
tags: "ams",
macros: {
bm: ["{\\mathbf #1}",1],
}
},
options: {
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex",
},
};

document$.subscribe(() => {
MathJax.startup.output.clearCache();
MathJax.typesetClear();
MathJax.texReset();
MathJax.typesetPromise();
});
16 changes: 16 additions & 0 deletions docs/docs/stylesheets/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.md-typeset ul ul {
list-style-type: circle;
}

.md-typeset ul ul ul {
list-style-type: square;
}

.highlight span.filename {
background-color: #afadad;
line-height: 0.4;
}

.md-typeset h1 {
color: black;
}
Binary file added docs/docs/tutorials/Fe-spread.webp
Binary file not shown.
Binary file added docs/docs/tutorials/LaVO3.webp
Binary file not shown.
Binary file added docs/docs/tutorials/Na_qc.webp
Binary file not shown.
Binary file added docs/docs/tutorials/W_bs.webp
Binary file not shown.
Binary file added docs/docs/tutorials/W_fit.webp
Binary file not shown.
Binary file added docs/docs/tutorials/cnt_qc.webp
Binary file not shown.
Binary file added docs/docs/tutorials/cnt_tran.webp
Binary file not shown.
Binary file added docs/docs/tutorials/cnt_win.webp
Binary file not shown.
Binary file added docs/docs/tutorials/cu.webp
Binary file not shown.
Binary file added docs/docs/tutorials/kdotp_bands_SX.webp
Binary file not shown.
Binary file added docs/docs/tutorials/lead.webp
Binary file not shown.
Loading
Loading