-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
911dad4
commit 04879ff
Showing
93 changed files
with
23,299 additions
and
3,650 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 116 additions & 0 deletions
116
docs/en/programming-language/python/mkdocs/display-config_tips.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# Display Config Tips | ||
|
||
## Highlight notes, hints, and warnings in the text | ||
|
||
Reference: [admonition](https://squidfunk.github.io/mkdocs-material/reference/admonitions/) | ||
|
||
```yaml title="mkdocs.yml" linenums="1" | ||
markdown_extensions: | ||
- admonition # (1)! | ||
- pymdownx.details # (2)! | ||
- pymdownx.superfences # (3)! | ||
``` | ||
1. highlight notes, hints, and warnings in the text | ||
2. detail block(!!! to ???) | ||
3. code fence | ||
!!! tip | ||
If you are using a markdown formatter (e.g. mdformat), you should use [pre-commit-hooks](https://pre-commit.com/#pre-commit-configyaml---hooks) to set up the [mdformat-mkdocs](https://github.com/KyleKing/mdformat-mkdocs#usage) plugin is recommended. | ||
The reason is that [here](./mdformat-tips.md/#mdformat-admon). | ||
## Display code block | ||
Reference: [Code blocks](https://squidfunk.github.io/mkdocs-material/reference/code-blocks/) | ||
## Tabbed display of code blocks | ||
```yaml title="mkdocs.yml" | ||
markdown_extensions: | ||
- pymdownx.superfences | ||
- pymdownx.tabbed: | ||
alternate_style: true | ||
``` | ||
=== "C" | ||
```c | ||
#include <stdio.h> | ||
|
||
int main(void) { | ||
printf("Hello world!\n"); | ||
return 0; | ||
} | ||
``` | ||
|
||
=== "C++" | ||
|
||
```c++ | ||
#include <iostream> | ||
int main(void) { | ||
std::cout << "Hello world!" << std::endl; | ||
return 0; | ||
} | ||
``` | ||
|
||
## Add copy, code selection, and annotations to code blocks | ||
|
||
```yaml title="mkdocs.yml" | ||
thema: | ||
features: | ||
- content.code.copy | ||
- content.code.select | ||
- content.code.annotate | ||
``` | ||
|
||
## Display code | ||
|
||
!!! tip | ||
|
||
- To highlight using pygments, enable the following comment-outs. | ||
- `linenums: true` displays the number of lines of code. | ||
- The number of lines is displayed without python `linenum="1"`. | ||
|
||
```yaml title="mkdocs.yml" | ||
markdown_extensions: | ||
- pymdownx.highlight: | ||
#use_pygments: true | ||
#noclasses: true | ||
#pygments_style: monokai | ||
linenums: true | ||
``` | ||
|
||
## Display code in admonition | ||
|
||
[Highlight notes, hints, and warnings in the text](#highlight-notes-hints-and-warnings-in-the-text)参照 | ||
|
||
## Display emoji | ||
|
||
```yaml title="mkdocs.yml" | ||
markdown_extensions: | ||
- pymdownx.emoji: | ||
emoji_index: !!python/name:materialx.emoji.twemoji | ||
emoji_generator: !!python/name:materialx.emoji.to_svg | ||
``` | ||
|
||
:smile: | ||
|
||
:simple-bitcoin: | ||
|
||
## Pop-up image display | ||
|
||
[glightbox](https://github.com/blueswen/mkdocs-glightbox) plugin. | ||
|
||
```bash | ||
poetry add mkdocs-glightbox | ||
``` | ||
|
||
```bash | ||
pip install mkdocs-glightbox | ||
``` | ||
|
||
```yaml title="mkdocs.yml" | ||
plugins: | ||
- glightbox | ||
``` |
47 changes: 47 additions & 0 deletions
47
docs/en/programming-language/python/mkdocs/doc_config-tips.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Document Config Tips | ||
|
||
!!! tip | ||
|
||
- The configuration of documents is specified in `nav` of `mkdocs.yml`. | ||
- When `nav` is set, a list of documents will be displayed on the left side of the screen. | ||
- Based on the following `nav` setting, it will be easy to manage the configuration suitable for adding and changing documents. | ||
|
||
```yaml title="mkdocs.yaml" | ||
nav: # (1)! | ||
- Home: index.md # (2)! | ||
- Programming language: | ||
- ja/programming-language/index.md # (3)! | ||
- Python: | ||
- ja/programming-language/python/index.md # (4)! | ||
- Mkdocs tips: | ||
- ja/programming-language/python/mkdocs/index.md # (5)! | ||
- ja/programming-language/python/mkdocs/display-config_tips.md # (6)! | ||
``` | ||
1. Set `index.md` as the link destination when `- navigation.indexes` setting is enabled | ||
2. Initial page | ||
3. Initial page in the Programming language section | ||
4. Initial page in the Python section | ||
5. ・Initial page of Mkdocs tips<br/> | ||
・The notation `Page1: ja/programming-language/python/mkdocs/index.md` is also possible.<br/> | ||
・If not explicitly displayed, the content of the "h1" tag is displayed. | ||
6. Accessible by setting up a link in a subsection or in `index.md | ||
|
||
## nav display settings | ||
|
||
!!! tip | ||
|
||
For configurations with multiple documents, the following settings are sufficient | ||
|
||
```yaml title="mkdocs.yaml" | ||
theme: | ||
features: | ||
# Enable link setting on section | ||
- navigation.indexes | ||
# Back-to-top button | ||
- navigation.top | ||
# groups in the sidebar | ||
#- navigation.sections | ||
# expand all collapsible subsections | ||
#- navigation.expand | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# MkDocs tips | ||
|
||
MkDocs is a static site generator. Contents are basically source files written in markdown format. | ||
|
||
!!! warning | ||
This article describes the subject content of [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) unless otherwise noted. | ||
|
||
## Usage | ||
|
||
For more information, please check the following: | ||
|
||
- [Official Documents](https://squidfunk.github.io/mkdocs-material/getting-started/) | ||
- [Reference](./mkdocs-tips.md/#reference) | ||
|
||
## Settings | ||
|
||
Various settings for contents are described in `mkdocs.yml`. | ||
|
||
### [Document Configuration](./doc_config-tips.md) | ||
|
||
### [Display](./display-config_tips.md) | ||
|
||
## Reference | ||
|
||
I am referring to the following article. | ||
|
||
- [なかけんのMkDocsノート](https://mkdocs.nakaken88.com/) | ||
- [コジオン: チェスさんのGitHub Pages(MkDocs)](https://kojion.github.io/chess/mkdocs/001/) | ||
- [MkDocsによるドキュメント作成](https://zenn.dev/mebiusbox/articles/81d977a72cee01) | ||
- [Github Pages / ゼロから学ぶPython](https://rinatz.github.io/python-book) | ||
- [プロジェクトドキュメント構築向け静的サイトジェネレータ『MkDocs』及び『Material for MkDocs』の個人的導入&設定まとめ](https://dev.classmethod.jp/articles/mkdocs-and-material-for-mkdocs-tips-matome/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.