Skip to content

Commit b1fbde1

Browse files
thatlittleboysamukweku
authored andcommitted
[INF] update some mkdocs infrastructure (#1231)
1 parent 801a469 commit b1fbde1

8 files changed

+67
-34
lines changed

.pre-commit-config.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ repos:
1313
hooks:
1414
- id: black
1515
args: [--config, pyproject.toml]
16+
# - repo: https://github.com/pycqa/isort
17+
# rev: 5.11.2
18+
# hooks:
19+
# - id: isort
20+
# name: isort (python)
1621
- repo: https://github.com/econchick/interrogate
1722
rev: 1.5.0
1823
hooks:

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
- [INF] Replace `pytest.ini` file with `pyproject.toml` file. PR #1204 @Zeroto521
66
- [INF] Extract docstrings tests from all tests. PR #1205 @Zeroto521
7-
- [BUG] address the `TypeError` when importing v0.24.0 (issue #1201 @xujiboy and @joranbeasley)
7+
- [BUG] Address the `TypeError` when importing v0.24.0 (issue #1201 @xujiboy and @joranbeasley)
88
- [INF] Fixed issue with missing PyPI README. PR #1216 @thatlittleboy
9+
- [INF] Update some `mkdocs` compatibility code. PR #1231 @thatlittleboy
910
- [DEPR] Add deprecation warnings for `process_text`, `rename_column`, `rename_columns`, `filter_on`, `remove_columns`, `fill_direction`. #1045 @samukweku
1011
- [ENH] `pivot_longer` now supports named groups where `names_pattern` is a regular expression. A dictionary can now be passed to `names_pattern`, and is internally evaluated as a list/tuple of regular expressions. Issue #1209 @samukweku
1112
- [ENH] Add `summarize` function. Issue #1225 @samukweku

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ release:
1616

1717
format:
1818
@echo "Applying Black Python code formatting..."
19-
black -l 79 .
19+
pre-commit run black --all-files
2020

2121
test:
2222
@echo "Running test suite..."
2323
pytest -v -n auto --color=yes
2424

2525
lint:
2626
@echo "Checking code formatting..."
27-
flake8 . --exclude "./nbconvert_config.py, ./env, ./venv ./build"
27+
pre-commit run flake8 --all-files
2828

2929
docs:
3030
@echo "Building documentation..."

environment-dev.yml

+1-7
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@ channels:
44
dependencies:
55
- python=3.9
66
- biopython
7-
- black=22.1.0
7+
- black=22.12.0 # keep this in sync with `.pre-commit-config.yaml`
88
- bump2version=1.0.1
99
- cairo
1010
- conda
11-
- darglint
12-
- doc8
13-
- flake8
1411
- hypothesis
15-
- interrogate
1612
- ipykernel
1713
- ipython
1814
- isort
@@ -38,8 +34,6 @@ dependencies:
3834
- pipreqs
3935
- pip-tools
4036
- pre-commit
41-
- pyflakes
42-
- pylint
4337
- pyspark>=3.2.0
4438
- pytest
4539
- pytest-cov

mkdocs.yml

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
site_name: pyjanitor documentation
22
site_url: https://pyjanitor-devs.github.io/pyjanitor
3+
watch:
4+
- janitor/
35

46
docs_dir: mkdocs/
57

@@ -11,15 +13,17 @@ theme:
1113
icon:
1214
logo: "fontawesome/solid/book"
1315
features:
14-
- instant
15-
# - tabs
16+
- navigation.instant
17+
# - navigation.tabs
18+
- navigation.top
19+
- toc.follow
20+
- content.code.copy
1621
language: en
1722

1823
# We customize the navigation by hand to control the order
1924
# in which pages show up.
2025
nav:
2126
- Home: index.md
22-
- Development Guide: devguide.md
2327
- API Reference:
2428
- Functions: api/functions.md
2529
- Biology: api/biology.md
@@ -32,6 +36,7 @@ nav:
3236
# - PySpark: api/pyspark.md # will be added back later
3337
- Timeseries: api/timeseries.md
3438
- XArray: api/xarray.md
39+
- Development Guide: devguide.md
3540
- Changelog: CHANGELOG.md
3641
- Authors: AUTHORS.md
3742

@@ -48,8 +53,6 @@ plugins:
4853
selection:
4954
docstring_style: restructured-text
5055
# custom_templates: templates
51-
watch:
52-
- janitor/
5356
# - mknotebooks:
5457
# execute: true
5558
# write_markdown: true
@@ -66,11 +69,9 @@ markdown_extensions:
6669
- pymdownx.highlight:
6770
use_pygments: false
6871
- pymdownx.inlinehilite
69-
# - pymdownx.tabbed
70-
# - pymdownx.arithmatex
71-
# - pymdownx.details
72-
# - pymdownx.superfences
73-
# - markdown.extensions.attr_list
72+
# - pymdownx.tabbed:
73+
# alternate_style: true
74+
- pymdownx.superfences
7475

7576
extra_javascript:
7677
- https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML

mkdocs/css/apidocs.css

+41-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,46 @@
11
/* https://mkdocstrings.github.io/theming/#css-classes */
2-
.doc-property { border-radius: 15px; padding: 0 5px; }
3-
.doc-property-special { background-color: blue; color: white; }
4-
.doc-property-private { background-color: red; color: white; }
5-
.doc-property-property { background-color: green; color: white; }
6-
.doc-property-read-only { background-color: yellow; color: black; }
2+
.doc-property {
3+
border-radius: 15px;
4+
padding: 0 5px;
5+
}
6+
.doc-property-special {
7+
background-color: blue;
8+
color: white;
9+
}
10+
.doc-property-private {
11+
background-color: red;
12+
color: white;
13+
}
14+
.doc-property-property {
15+
background-color: green;
16+
color: white;
17+
}
18+
.doc-property-read-only {
19+
background-color: yellow;
20+
color: black;
21+
}
722

823
/* https://mkdocstrings.github.io/handlers/python/#recommended-style-material */
924
/* Indentation. */
1025
div.doc-contents:not(.first) {
11-
padding-left: 25px;
12-
border-left: 4px solid rgba(230, 230, 230);
13-
margin-bottom: 80px;
14-
}
26+
padding-left: 25px;
27+
border-left: 4px solid rgba(230, 230, 230);
28+
margin-bottom: 80px;
29+
}
30+
31+
/* add a keyboard shortcut icon for search bar,
32+
* https://github.com/squidfunk/mkdocs-material/issues/2574#issuecomment-821979698
33+
*/
34+
[data-md-toggle="search"]:not(:checked) ~ .md-header .md-search__form::after {
35+
position: absolute;
36+
top: 0.3rem;
37+
right: 0.3rem;
38+
display: block;
39+
padding: 0.1rem 0.4rem;
40+
color: var(--md-default-bg-color--lighter);
41+
font-weight: bold;
42+
font-size: 0.8rem;
43+
border: 0.05rem solid var(--md-default-bg-color--lighter);
44+
border-radius: 0.1rem;
45+
content: "/";
46+
}

mkdocs/devguide.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ selecting the correct kernel from the top right corner of JupyterLab!
8787
For PyCharm users,
8888
here are some `instructions <PYCHARM_USERS.html>`__ to get your Conda environment set up.
8989

90-
### Install the pre-commit hooks.
90+
### Install the pre-commit hooks
9191

9292
`pre-commit` hooks are available
9393
to run code formatting checks automagically before git commits happen.
@@ -172,8 +172,8 @@ formatted and that all tests still pass.
172172

173173
To do so:
174174

175-
* Run `python -m flake8 --exclude nbconvert_config.py janitor` to check code styling problems
176-
* Run `python -m black -c pyproject.toml` to format your code.
175+
* Run `make lint` to check code styling problems.
176+
* Run `make format` to format your code.
177177
* Run `python -m interrogate -c pyproject.toml` to check your code for missing docstring.
178178
* Run `darglint -v 2` to check quality of your docstrings.
179179
* Run `python -m pytest` to run all unit tests.

mkdocs/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ provides a clean API for cleaning data.
1010

1111
## Quick start
1212

13-
- Installation: `conda install -c conda-forge pyjanitor`
14-
- Check out the collection of [general functions](https://pyjanitor-devs.github.io/pyjanitor/api/functions/)
13+
- Installation: `conda install -c conda-forge pyjanitor`. Read more installation instructions [here](https://pyjanitor-devs.github.io/pyjanitor/#installation).
14+
- Check out the collection of [general functions](https://pyjanitor-devs.github.io/pyjanitor/api/functions/).
1515

1616
## Why janitor?
1717

0 commit comments

Comments
 (0)