iFEM site development notes
Adding new pages in documentation site
- Writing in markdown.
- To put it under a certain category, copy the markdown file together with its image folder (under the same name) to
_pages
(documents for iFEM usage, community research, update, logs, etc). Directly copying_todo
foldersfem
,afem
,solver
to_fem
,_afem
,_solver
is easier but we need to add those folders toinclude:
in_config.yml
. - Adding the following preamble to the markdown file: where
category
is eitherfem
,afem
,solver
, etc.--- permalink: /category/page-name/ title: "Page Title" sidebar: nav: docs ---
- The default left sidebar navigation is
docs
, there are other navigation links in_data/navigation.yml
.
Testing pages
- To test building the site locally, install
ruby
andjekyll
(see below for details). - To add a test page, we can add
test_something.md
in_pages
, then the page can be accessed directly without being shown up in the site using thepermalink
in the markdown file’s preamble. Ifpermalink: /test/test_something/
is added, thenhttp://localhost:4000/ifem/test/test_something/
should work in the local served version andhttp://lyc1012.github.io/ifem/test/test_something/
when deployed.
CHANGELOG
July 27, 2021
- Adding Jekyll preambles to un-deployed
.md
converted from the old/ifemdoc/*/*.ipynb
are in_todo
. - re-organizing
_todo
folders to their corresponding iFEM main repo folders. - manually checked the links in nav.
July 25, 2021
Manually verified building on MacOS. Installation guide on MacOS: https://jekyllrb.com/docs/installation/macos/. The easiest way is to use brew
to install ruby
and jekyll
.
brew install ruby
then
# If you're using Zsh
echo 'export PATH="/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/3.0.0/bin:$PATH"' >> ~/.zshrc
# If you're using Bash
echo 'export PATH="/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/3.0.0/bin:$PATH"' >> ~/.bash_profile
After Ruby is installed, install Jekyll using gem install --user-install bundler jekyll
. Now under the docs
folder, run bundle install
to install the dependencies then bundle exec jekyll serve
will start a localhost to serve the pages at http://127.0.0.1:4000/ifem/
.
July 23, 2021
- Set up the doc site.
- Navigation
/_data/navigation.yml
controls all the navigation bars. - Main scss is
assets/css/main.scss
controls the main CSS styles. Global var is defined before@import
, syntax highlighting and colors can be defined in the same file after@import "minimal-mistakes/skins/default"
, adjustment to others or customized CSS can be added after@import "minimal-mistakes"
. - $\LaTeX$ can be added using the usual
$ $
or$$ $$
.- Kramdown supports
\eqref
as well. For an example, please refer to_docs/fem-poisson.md
. Inside the mathmode, at the end of an equation, add\tag{num}\label{label_name}
, then\eqref{}
can be directly called in the main text. - In MathJax,
\{\}
needs to be rewritten to\\{\\}
to escape the backslash interpreter for HTML; also for nested subscripts or subscripts in superscripts, the underscore_
needs a backslash\
before it, for example,$u_{g_D}$
needs to be$u_{g\_D}$
.
- Kramdown supports