Skip to content

Commit

Permalink
📝 Update contents
Browse files Browse the repository at this point in the history
  • Loading branch information
7rikazhexde committed Sep 30, 2023
1 parent 911dad4 commit 04879ff
Show file tree
Hide file tree
Showing 93 changed files with 23,299 additions and 3,650 deletions.
6 changes: 5 additions & 1 deletion .markdownlint.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@

// Inline HTML / raw HTMLの記入
// MD009を無効にする変わりに改行に<br/>を使用するため無効にする。
"MD033": false
"MD033": false,

// Fenced code blocks should have a language specified / フェンスされたコードブロックには言語を指定する必要があります
// 言語に問わずハイライトした方が良いので有効にする。
//"MD040": false

// Forced code block style / indented:,consistent,fencedのルールを強制する
// pymdownx.tabbed(コードブロックのタブ)を有効にするため無効にする
"MD046": false
}
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
# yaml syntax check
- id: check-yaml
# Exclude check for "could not determine a constructor for the tag 'tag:yaml.org,2002:python/name:materialx.emoji.twemoji'"
# args: [--unsafe]
args: [--unsafe]

# https://python-poetry.org/docs/pre-commit-hooks/#usage
- repo: https://github.com/python-poetry/poetry
Expand Down Expand Up @@ -116,14 +116,14 @@ repos:
# types: [markdown]

# Original script
#- id: update-pyproject
# name: mkdocs build
# entry: poetry run python ci/run_mkdocs_cmd.py
# language: system
# verbose: true
# pass_filenames: false
# stages: [commit]
# additional_dependencies: []
- id: update-pyproject
name: mkdocs build
entry: poetry run python ci/run_mkdocs_cmd.py
language: system
verbose: true
pass_filenames: false
stages: [commit]
additional_dependencies: []

#- id: update-pyproject
# name: Update pyproject.toml version
Expand Down
12 changes: 6 additions & 6 deletions docs/en/aws/dynamodb/dynamodb-local-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

??? info "create_table.py"

```python
```python title="" linenums="1"
import boto3

def create_table(dynamodb=None):
Expand Down Expand Up @@ -69,7 +69,7 @@

??? info "get_table_lists.py"

```python
```python title="" linenums="1"
import boto3
import os

Expand Down Expand Up @@ -98,7 +98,7 @@ Batch add the following csv files.

??? info "data.csv"

```csv
```csv title="" linenums="1"
2023-03-03T00:05:14.071359,ALONE,414.0,1.0,87.99,221.0,135.0,92.04,224.0,125.0,90.19,214.0,130.0,90.72,234.0,130.0,89.26,208.0,140.0,77.73,262.0,160.0,86.77,205.0,185.0,85.84,281.0,210.0,88.13,208.0,240.0,89.21,288.0,260.0,89.16,214.0,280.0,70.95,269.0,270.0,73.1,240.0,285.0,76.71,288.0,340.0,79.44,259.0,345.0,78.61,307.0,395.0,83.3,281.0,395.0
2023-03-04T00:05:14.487122,ALONE,415.0,1.0,87.26,221.0,135.0,90.62,224.0,125.0,89.26,214.0,130.0,88.96,234.0,130.0,87.7,208.0,140.0,77.78,262.0,160.0,86.47,205.0,185.0,85.11,281.0,210.0,85.35,208.0,240.0,87.94,285.0,260.0,87.84,214.0,280.0,72.22,269.0,270.0,72.02,237.0,285.0,76.71,288.0,340.0,81.84,259.0,345.0,79.39,304.0,395.0,83.35,281.0,395.0
2023-03-05T00:05:14.890360,ALONE,416.0,1.0,85.99,221.0,136.0,90.48,224.0,126.0,87.3,214.0,131.0,88.62,234.0,131.0,90.82,205.0,141.0,76.61,262.0,161.0,84.18,202.0,186.0,85.99,281.0,211.0,88.82,208.0,241.0,89.21,288.0,261.0,89.5,214.0,281.0,71.53,269.0,271.0,73.19,240.0,286.0,77.05,288.0,336.0,82.23,259.0,346.0,79.83,304.0,396.0,81.1,281.0,391.0
Expand Down Expand Up @@ -131,7 +131,7 @@ Batch add the following csv files.

??? info "bulk_incert.py"

```python
```python title="" linenums="1"
import pandas as pd
import boto3
from decimal import Decimal
Expand Down Expand Up @@ -179,7 +179,7 @@ Batch add the following csv files.

??? info "get_items_float.py"

```python
```python title="" linenums="1"
import boto3
from decimal import Decimal

Expand Down Expand Up @@ -223,7 +223,7 @@ The code outputs the same file as the original data (data.csv) to a CSV file (ge

??? info "get_tbl_data_to_sort_csv.py"

```python
```python title="" linenums="1"
import boto3
import pandas as pd
from decimal import Decimal
Expand Down
2 changes: 1 addition & 1 deletion docs/en/programming-language/python/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- [pre-commit tips](./pre-commit-tips.md)
- [pymysql tips](./pymysql-tips.md)
- [mdformat tips](./mdformat-tips.md)
- [mkdocs tips](./mkdocs-tips.md)
- [mkdocs tips](./mkdocs/index.md)

## Script

Expand Down
35 changes: 15 additions & 20 deletions docs/en/programming-language/python/mkdocs-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,25 @@ For more information, please check the following:
- [Official Documents](https://squidfunk.github.io/mkdocs-material/getting-started/)
- [Reference](./mkdocs-tips.md/#reference)

### Highlight notes, hints, and warnings in the text

Reference: [admonition](https://squidfunk.github.io/mkdocs-material/reference/admonitions/)

```yaml title="" linenums="1"
markdown_extensions:
- admonition # (1)!
- pymdownx.details # (2)!
- pymdownx.superfences # (3)!
```
1. Highlight notes, hints, and warnings within sentences
2. detail blocks (!!!! to ??? to be)
3. code fences
!!! 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).
### mkdocs.yml

```yaml
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
hooks:
- id: mdformat
additional_dependencies:
- mdformat-admon
- mdformat-beautysh
- mdformat-black
- mdformat-config
- mdformat-footnote
- mdformat-frontmatter
- mdformat-simple-breaks
- mdformat-tables
- mdformat-toc
- mdformat-web
```
## Reference
I am referring to the following article.
Expand Down
116 changes: 116 additions & 0 deletions docs/en/programming-language/python/mkdocs/display-config_tips.md
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 docs/en/programming-language/python/mkdocs/doc_config-tips.md
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
```
31 changes: 31 additions & 0 deletions docs/en/programming-language/python/mkdocs/index.md
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/)
10 changes: 5 additions & 5 deletions docs/ja/aws/dynamodb/dynamodb-local-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

??? info "create_table.py"

```python
```python title="" linenums="1"
import boto3

def create_table(dynamodb=None):
Expand Down Expand Up @@ -69,7 +69,7 @@

??? info "get_table_lists.py"

```python
```python title="" linenums="1"
import boto3
import os

Expand Down Expand Up @@ -98,7 +98,7 @@

??? info "data.csv"

```csv
```csv title="" linenums="1"
2023-03-03T00:05:14.071359,ALONE,414.0,1.0,87.99,221.0,135.0,92.04,224.0,125.0,90.19,214.0,130.0,90.72,234.0,130.0,89.26,208.0,140.0,77.73,262.0,160.0,86.77,205.0,185.0,85.84,281.0,210.0,88.13,208.0,240.0,89.21,288.0,260.0,89.16,214.0,280.0,70.95,269.0,270.0,73.1,240.0,285.0,76.71,288.0,340.0,79.44,259.0,345.0,78.61,307.0,395.0,83.3,281.0,395.0
2023-03-04T00:05:14.487122,ALONE,415.0,1.0,87.26,221.0,135.0,90.62,224.0,125.0,89.26,214.0,130.0,88.96,234.0,130.0,87.7,208.0,140.0,77.78,262.0,160.0,86.47,205.0,185.0,85.11,281.0,210.0,85.35,208.0,240.0,87.94,285.0,260.0,87.84,214.0,280.0,72.22,269.0,270.0,72.02,237.0,285.0,76.71,288.0,340.0,81.84,259.0,345.0,79.39,304.0,395.0,83.35,281.0,395.0
2023-03-05T00:05:14.890360,ALONE,416.0,1.0,85.99,221.0,136.0,90.48,224.0,126.0,87.3,214.0,131.0,88.62,234.0,131.0,90.82,205.0,141.0,76.61,262.0,161.0,84.18,202.0,186.0,85.99,281.0,211.0,88.82,208.0,241.0,89.21,288.0,261.0,89.5,214.0,281.0,71.53,269.0,271.0,73.19,240.0,286.0,77.05,288.0,336.0,82.23,259.0,346.0,79.83,304.0,396.0,81.1,281.0,391.0
Expand Down Expand Up @@ -179,7 +179,7 @@

??? info "get_items_float.py"

```python
```python title="" linenums="1"
import boto3
from decimal import Decimal

Expand Down Expand Up @@ -223,7 +223,7 @@

??? info "get_tbl_data_to_sort_csv.py"

```python
```python title="" linenums="1"
import boto3
import pandas as pd
from decimal import Decimal
Expand Down
Loading

0 comments on commit 04879ff

Please sign in to comment.