Skip to content

Commit

Permalink
Replaced Markdown-SPA to markdown_spa
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSpaar committed Jan 12, 2024
1 parent 33b66a0 commit 024b239
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![GitHub Release](https://img.shields.io/github/v/release/mrspaar/markdown_spa?&logo=github)](https://github.com/mrspaar/markdown_spa/releases)
[![GitHub License](https://img.shields.io/github/license/MrSpaar/markdown_spa?logo=github)](https://github.com/mrspaar/markdown_spa/blob/master/LICENSE)

[Markdown-SPA](https://pypi.org/project/markdown_spa) is a Python ([`jinja2`](https://pypi.org/project/Jinja2/) + [`markdown`](https://pypi.org/project/Markdown/)) static site generator:
[markdown_spa](https://pypi.org/project/markdown_spa) is a Python ([`jinja2`](https://pypi.org/project/Jinja2/) + [`markdown`](https://pypi.org/project/Markdown/)) static site generator:

- [x] Powerful templating
- [x] SEO optimized
Expand Down
2 changes: 1 addition & 1 deletion doc/pages/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: How to setup automatic Github Pages deployment

Github-SPA includes a Github Actions workflow to automatically deploy a static website to Github Pages.
To enable it, go to your repository's settings and choose `Github Actions` as source in the `Pages` section:
![Enable Github Pages](/static/gh-pages.webp){: width="600" height="410" }
![Enable Github Pages](/static/gh-pages.webp){: width="681" height="469" }

Then, each relevant commit will trigger a new deployment using the `.github/static.yml` workflow (included in blank projects):
```yaml
Expand Down
8 changes: 4 additions & 4 deletions doc/pages/extensions.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
order: 4
name: Extensions
description: Documentation on Markdown-SPA's extension system
description: Documentation on markdown_spa's extension system

Markdown-SPA has a simple extension system that allows you to add custom functionality to your site.
`markdown_spa` has a simple extension system that allows you to add custom functionality to your site.
To install an extension, simply run the following command:
```bash
markdown_spa install <extension-name> <git_repo_url>
```

This will install the extension globally for your user.
Markdown-SPA will automatically load all extensions in the `config.ini` file:
`markdown_spa` will automatically load all extensions in the `config.ini` file:
```ini
[extension-name]
extension_option = value
Expand Down Expand Up @@ -58,7 +58,7 @@ Dependencies will be automatically installed and that part of the initialization

## Make an extension available to the user

Every Markdown-SPA extension must be a Python module that contains a class that inherits from `markdown_spa.Extension`.
Every `markdown_spa` extension must be a Python module that contains a class that inherits from `markdown_spa.Extension`.
The class' name determines the name of the extension and is used to install it.

Here is a minimal example of an extension:
Expand Down
2 changes: 1 addition & 1 deletion doc/pages/extensions/sitemap.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ order: 1
name: Sitemap
description: Automatic sitemap and robots.txt generation

`Sitemap` comes with `Markdown-SPA` by default, it allows you to generate a `sitemap.xml` and `robots.txt` files for your website.
`Sitemap` comes with `markdown_spa` by default, it allows you to generate a `sitemap.xml` and `robots.txt` files for your website.

To add it to an existing project, run `markdown_spa add Sitemap`, there are two options:

Expand Down
2 changes: 1 addition & 1 deletion doc/pages/features.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
order: 3
name: Features
description: Features of Markdown-SPA
description: Features of markdown_spa
2 changes: 1 addition & 1 deletion doc/pages/features/attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ order: 4
name: Attributes
description: How to add attributes to Markdown elements

Markdown-SPA uses the [attr-list](https://python-markdown.github.io/extensions/attr_list/) to add HTML to Markdown elements:
`markdown_spa` uses the [attr-list](https://python-markdown.github.io/extensions/attr_list/) to add HTML to Markdown elements:
```md
# This is a title
{: .anchored-title }
Expand Down
4 changes: 2 additions & 2 deletions doc/pages/features/templating.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
order: 1
name: Templating
description: How to use jinja2 templates in a Markdown-SPA project
description: How to use jinja2 templates in a markdown_spa project

Markdown-SPA uses [jinja2](https://jinja.palletsprojects.com/en/2.11.x/) as a templating engine. This allows you to create a base template that will be used for all pages, and to add custom variables to each page:
`markdown_spa` uses [jinja2](https://jinja.palletsprojects.com/en/2.11.x/) as a templating engine. This allows you to create a base template that will be used for all pages, and to add custom variables to each page:

| Default variable | Description |
| ------------------------ | ------------------------------------------------------------------- |
Expand Down
5 changes: 2 additions & 3 deletions doc/pages/features/toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ order: 5
name: Table of Contents
description: Automatically generated table of contents

The table of contents at the side of the page was automatically generated from the [`nav.html`](https://github.com/MrSpaar/Markdown-SPA/blob/master/templates/nav.html) template:
The table of contents at the side of this page was automatically generated from the `nav_template` in the `config.ini` file.
In blank projects, the template is the following:
```jinja
<ul>
{% for (uri, page) in tree.items() recursive -%}
Expand All @@ -28,5 +29,3 @@ Which will render the following HTML:
</li>
</ul>
```

You can modify the template as long as the name of the file is `nav.html` and it is located in the `templates` directory.
4 changes: 2 additions & 2 deletions doc/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ priority: 1
name: Quick start
description: A Python static site generator using Markdown, Jinja2, Pygments and libsass

[Markdown-SPA](https://github.com/MrSpaar/Markdown-SPA) is a Python ([jinja2](https://pypi.org/project/Jinja2/) + [markdown](https://pypi.org/project/Markdown/)) static site generator:
[`markdown_spa`](https://github.com/MrSpaar/markdown_spa) is a Python ([jinja2](https://pypi.org/project/Jinja2/) + [markdown](https://pypi.org/project/Markdown/)) static site generator:

- [x] Powerful templating
- [x] SEO optimized
Expand All @@ -14,7 +14,7 @@ description: A Python static site generator using Markdown, Jinja2, Pygments and

First, to setup a new project:

- Install the package (once): `pip install Markdown-SPA`
- Install the package (once): `pip install markdown_spa`
- Create a blank project: `markdown_spa init <folder (optionnal)>`

The `config.ini` file describes the project structure:
Expand Down
2 changes: 1 addition & 1 deletion doc/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<body>
<nav>
<div id="header">
<a href="/" id="home">Markdown-SPA</a>
<a href="/" id="home">markdown_spa</a>
<label for="show-nav" id="show-nav-label" tabindex="0">
<input type="checkbox" id="show-nav"/>
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="100" height="100" viewBox="0 0 50 50">
Expand Down
2 changes: 1 addition & 1 deletion src/markdown_spa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
__all__ = ["Generator", "Extension", "SASS", "Sitemap", "Tailwind"]
__version__ = environ.get(
"MARKDOWN_SPA_VERSION",
get("https://pypi.org/pypi/markdown-spa/json").json()["info"]["version"]
get("https://pypi.org/pypi/markdown_spa/json").json()["info"]["version"]
).removeprefix("v")


Expand Down
6 changes: 3 additions & 3 deletions src/markdown_spa/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
def main_group() -> int:
"""Static site generator for Markdown files."""

current = version("markdown-spa")
latest = get("https://pypi.org/pypi/markdown-spa/json").json()["info"]["version"]
current = version("markdown_spa")
latest = get("https://pypi.org/pypi/markdown_spa/json").json()["info"]["version"]

if latest > current:
secho(f"Version {latest} is available, run '{executable} -m pip install -U markdown-spa' to update.", fg="yellow", bold=True)
secho(f"Version {latest} is available, run '{executable} -m pip install -U markdown_spa' to update.", fg="yellow", bold=True)

return 0

Expand Down
2 changes: 1 addition & 1 deletion src/markdown_spa/cli/blank/pages/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Main page
description: This is the main page

This is a blank Markdown-SPA project.
This is a blank `markdown_spa` project.
4 changes: 2 additions & 2 deletions src/markdown_spa/cli/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@option("--full-traceback", "-ft", help="Show full traceback on error.", is_flag=True, default=False)
@argument("path", default=".")
def init(full_traceback: bool, path: str) -> int:
"""Create a blank Markdown-SPA project"""
"""Create a blank markdown_spa project"""

if exists(path):
secho("A file or directory with that name already exists!", fg="red", bold=True)
Expand Down Expand Up @@ -101,7 +101,7 @@ def watch(full_traceback: bool, config: str, path: str) -> int:
@option("--config", "-c", help="Path to the config file.", is_flag=False)
@argument("path", default=".")
def build(full_traceback: bool, config: str, path: str) -> int:
"""Build a Markdown-SPA project"""
"""Build a markdown_spa project"""

if err := check_dir(path):
secho(err, fg="red", bold=True)
Expand Down

0 comments on commit 024b239

Please sign in to comment.