Skip to content

Commit

Permalink
refactor!: rename template repository
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleKing committed Nov 27, 2022
1 parent dcc0026 commit 8d85d75
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Run pytest
run: |
pytest --cov=mdformat_plugin --cov-report=xml --cov-report=term-missing
pytest --cov=mdformat_admon --cov-report=xml --cov-report=term-missing
- name: Upload to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.7
Expand Down
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- id: check-yaml
- id: check-toml
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.8.0
rev: v1.9.0
hooks:
- id: python-check-blanket-noqa
- repo: https://github.com/timothycrosley/isort
rev: 5.8.0
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.10.0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.0
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear==21.3.2
- flake8-builtins==1.5.3
- flake8-comprehensions==3.4.0
- flake8-bugbear>=21.3.2
- flake8-builtins>=1.5.3
- flake8-comprehensions>=3.4.0
29 changes: 8 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
# mdformat-plugin
# mdformat-admon

[![Build Status][ci-badge]][ci-link]
[![codecov.io][cov-badge]][cov-link]
[![PyPI version][pypi-badge]][pypi-link]

An [mdformat](https://github.com/executablebooks/mdformat) plugin for...

## Required changes for a new plugin

This demonstration is setup with a plugin named `plugin`.
There are a number of locations to change.
At a top level for a plugin `foo` at least the following changes are required

- Global find and replace `mdformat_plugin` to `mdformat_foo` including folder names.
- Global find and replace `mdformat-plugin` to `mdformat-foo` including folder names.
- `tests/test_fixtures.py`: `output = mdformat.text(text, extensions={"plugin"})` becomes `output = mdformat.text(text, extensions={"foo"})`
- `pyproject.toml` in addition to the global find and replace: `plugin = "mdformat_plugin"` becomes `foo = "mdformat_foo"`

Do not forget to update authorship / maintainers in `pyproject.toml` as well.
An [mdformat](https://github.com/executablebooks/mdformat) plugin for admonitions.

## Development

Expand All @@ -41,7 +28,7 @@ and with test coverage:
tox -e py37-cov
```

The easiest way to write tests, is to edit tests/fixtures.md
The easiest way to write tests, is to edit `tests/fixtures.md`

To run the code formatting and style checks:

Expand Down Expand Up @@ -75,9 +62,9 @@ or trigger the GitHub Action job, by creating a release with a tag equal to the

Note, this requires generating an API key on PyPi and adding it to the repository `Settings/Secrets`, under the name `PYPI_KEY`.

[ci-badge]: https://github.com/executablebooks/mdformat-plugin/workflows/CI/badge.svg?branch=master
[ci-badge]: https://github.com/executablebooks/mdformat-admon/workflows/CI/badge.svg?branch=master
[ci-link]: https://github.com/executablebooks/mdformat/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush
[cov-badge]: https://codecov.io/gh/executablebooks/mdformat-plugin/branch/master/graph/badge.svg
[cov-link]: https://codecov.io/gh/executablebooks/mdformat-plugin
[pypi-badge]: https://img.shields.io/pypi/v/mdformat-plugin.svg
[pypi-link]: https://pypi.org/project/mdformat-plugin
[cov-badge]: https://codecov.io/gh/executablebooks/mdformat-admon/branch/master/graph/badge.svg
[cov-link]: https://codecov.io/gh/executablebooks/mdformat-admon
[pypi-badge]: https://img.shields.io/pypi/v/mdformat-admon.svg
[pypi-link]: https://pypi.org/project/mdformat-admon
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["flit_core >=3.2.0,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "mdformat_plugin"
name = "mdformat_admon"
authors = [
{ name = "Chris Sewell", email = "[email protected]" },
]
Expand All @@ -30,10 +30,10 @@ test = [
dev = ["pre-commit"]

[project.urls]
Homepage = "https://github.com/executablebooks/mdformat-plugin"
Homepage = "https://github.com/executablebooks/mdformat-admon"

[project.entry-points."mdformat.parser_extension"]
plugin = "mdformat_plugin"
admon = "mdformat_admon"

[tool.flit.sdist]
include = []
Expand All @@ -46,7 +46,7 @@ force_sort_within_sections = true
no_lines_before = ["LOCALFOLDER"]

# Configure isort to work without access to site-packages
known_first_party = ["mdformat_plugin", "tests"]
known_first_party = ["mdformat_admon", "tests"]

# Settings for Black compatibility
profile = "black"
2 changes: 1 addition & 1 deletion tests/test_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"line,title,text,expected", fixtures, ids=[f[1] for f in fixtures]
)
def test_fixtures(line, title, text, expected):
output = mdformat.text(text, extensions={"plugin"})
output = mdformat.text(text, extensions={"admon"})
print(output)
assert output.rstrip() == expected.rstrip(), output
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ commands = pytest {posargs}

[testenv:py{36,37,38,39}-cov]
extras = test
commands = pytest --cov={envsitepackagesdir}/mdformat_plugin {posargs}
commands = pytest --cov={envsitepackagesdir}/mdformat_admon {posargs}

[testenv:py{36,37,38,39}-pre-commit]
extras = dev
Expand Down

0 comments on commit 8d85d75

Please sign in to comment.