-
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
8432027
commit d4b12c6
Showing
7 changed files
with
274 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: "Release" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: "The version to tag" | ||
type: string | ||
sha: | ||
description: "The full sha of the commit to be release. If omitted, the most recent commit on the default branch will be used." | ||
default: "" | ||
type: string | ||
jobs: | ||
tag-release: | ||
name: Tag Release | ||
runs-on: ubuntu-latest | ||
if: ${{ inputs.tag }} | ||
needs: pypi-publish | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.sha }} | ||
- name: Git tag | ||
run: | | ||
git config user.name "Github Actions" | ||
git config user.email "[email protected]" | ||
git tag -m "${{ inputs.tag }}" "${{ inputs.tag }}" | ||
git push --tags | ||
pypi-publish: | ||
name: upload release to PyPI | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# IMPORTANT: this permission is mandatory for trusted publishing | ||
id-token: write | ||
|
||
steps: | ||
# retrieve your distributions here | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.sha }} | ||
|
||
- name: Install rye | ||
uses: eifinger/setup-rye@v1 | ||
with: | ||
enable-cache: true | ||
- name: Install Dependencies | ||
run: rye sync | ||
- name: Build Project | ||
run: rye build | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
skip_existing: true | ||
packages_dir: dist | ||
verbose: true | ||
|
||
publish-release: | ||
name: Publish to Github | ||
runs-on: ubuntu-latest | ||
needs: tag-release | ||
steps: | ||
- uses: softprops/action-gh-release@v1 | ||
with: | ||
draft: true | ||
tag_name: ${{ inputs.tag }} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
**/__pycache__/ | ||
tests/.coverage | ||
.coverage | ||
dist/ |
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,19 @@ | ||
Copyright (c) 2023 Tyler Baur | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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 |
---|---|---|
@@ -1,6 +1,77 @@ | ||
# PyMdown Extensions Blocks | ||
|
||
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) | ||
![PyPI - Version](https://img.shields.io/pypi/v/pymdownx-blocks) | ||
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pymdownx-blocks) | ||
![Tests](https://img.shields.io/github/actions/workflow/status/TillerBurr/pymdownx-blocks/tests) | ||
|
||
|
||
|
||
These are a collection of blocks for the [PyMdown Extensions](https://facelessuser.github.io/pymdown-extensions) that I find useful. | ||
|
||
This project is not affiliated with the PyMdown Extensions project and is currently in a very early stage. Currently, there is only one block: `DirTree`. | ||
|
||
## Installation | ||
|
||
```bash | ||
pip install pymdownx-blocks | ||
``` | ||
|
||
## Usage | ||
This can be used in MkDocs or by itself. To use in a Python file, we use the following: | ||
|
||
```python | ||
import markdown | ||
|
||
yaml_str=... | ||
md=markdown.Markdown(extensions=['pymdownx_blocks.dirtree']) | ||
``` | ||
|
||
To use in MkDocs, register the extension. | ||
|
||
```yaml | ||
... | ||
markdown_extensions: | ||
... | ||
- pymdownx_blocks.dirtree | ||
... | ||
``` | ||
|
||
In a markdown file, | ||
``` | ||
///dirtree | ||
root: | ||
- subdir: | ||
- File | ||
- another subdir: | ||
- anotherfile.txt | ||
- file.csv | ||
/// | ||
``` | ||
|
||
|
||
When rendered, this will produce the following tree | ||
|
||
<div> | ||
<pre class="admonition note"><p class="admonition-title">Directory Structure</p> | ||
<p> | ||
root | ||
├── subdir | ||
│ └── File | ||
└── another subdir | ||
├── anotherfile.txt | ||
└── file.csv | ||
</p></pre> | ||
</div> | ||
|
||
|
||
## Contributing | ||
|
||
More blocks are always welcome! This project uses [rye](https:rye-up.com) for dependency | ||
management. | ||
|
||
1. Fork the repository | ||
2. Create a branch with the name of the block | ||
3. Implement the block | ||
4. Create a pull request. |
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.