mdiocre


Namemdiocre JSON
Version 3.5.3 PyPI version JSON
download
home_pagehttps://zumi.neocities.org/stuff/mdiocre
SummaryStatic website generator
upload_time2023-07-02 10:32:49
maintainer
docs_urlNone
authorZumi Daxuya
requires_python
licenseMIT
keywords converter generator markdown html static
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # MDiocre

![MDiocre](logo.svg)

A very simple static website generator tool powered by Python. It primarily converts Markdown files and combines it with an HTML template, but can be extended to other markup.

## Requirements

* Python 3 (`python-markdown` + `py-gfm`)

## Other Requirements

**ReStructuredText** (RST) support requires `docutils` to be installed.

If you want to build the **documentation**, you will have to install Sphinx as well.

## What sets it apart from other tools?

It's terrible and it doesn't have a profitable and pragmatic usecase in mind, but it works okay. For my needs, anyway. It's alright for simple blogs with no tagging and very simple static websites.

## How do I make a site with this?

1. Install `mdiocre` by using the command: `python3 -m pip install mdiocre`.

2. Create a work folder. Let's call it `work`.

3. Make a file called `template.html` inside that folder with these contents:
   
   ```
   <html>
   <head>Welcome to my website!</head>
   <body><!--:content--></body>
   </html>
   ```

4. Create a folder called `src`, and make a file inside of it called `index.md`, and write anything on it.

5. After your content (or before, it doesn't matter), add: `<!--:mdiocre-template="../template.html"-->`

6. Go back a level to your `work` folder. Assuming Python is present in your PATH (environment variable), create a new text document containing:
   
   ```
   python3 -m mdiocre.interface.cli src build
   ```
   
   Save it inside the folder as a .bat if you're on Windows, or as a .sh if you're on Mac, Linux, or other Unix-like systems. Double click or execute it.

7. Check the `build` folder.

## Variables

MDiocre allows setting variables. These variables are per-page, and can be read by the template. Both the template and the markdown page share the same format for templates - which are HTML comments with the first character after the markup being the colon (:)

**Setting a variable to a string**

```
<!--: hello = "test message" -->
```

Simply sets `hello` to `test message`. When using a comma, make sure to escape it with \\!

**Setting a variable to another variable**

```
<!--: hello = lemons -->
```

If `lemons` is `1` then `hello` will also be `1`. If `lemons` is not set, `hello` will contain the string `lemons`.

**Concatenating two or more variables**

```
<!--: lemons = hello, hello -->
```

If `hello` contains `abc` then `lemons` will contain `abcabc`. However, if you also include a space string in between, like this...

```
<!-- lemons = hello, " ", hello -->
```

`lemons` will contain `abc abc`!

            

Raw data

            {
    "_id": null,
    "home_page": "https://zumi.neocities.org/stuff/mdiocre",
    "name": "mdiocre",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "converter,generator,markdown,html,static",
    "author": "Zumi Daxuya",
    "author_email": "daxuya.zumi+mdiocre@protonmail.com",
    "download_url": "https://files.pythonhosted.org/packages/4c/0b/7b8fced8c37d1da633554ea438b0cbd764987c30882501ba87a59490ccec/mdiocre-3.5.3.tar.gz",
    "platform": null,
    "description": "# MDiocre\n\n![MDiocre](logo.svg)\n\nA very simple static website generator tool powered by Python. It primarily converts Markdown files and combines it with an HTML template, but can be extended to other markup.\n\n## Requirements\n\n* Python 3 (`python-markdown` + `py-gfm`)\n\n## Other Requirements\n\n**ReStructuredText** (RST) support requires `docutils` to be installed.\n\nIf you want to build the **documentation**, you will have to install Sphinx as well.\n\n## What sets it apart from other tools?\n\nIt's terrible and it doesn't have a profitable and pragmatic usecase in mind, but it works okay. For my needs, anyway. It's alright for simple blogs with no tagging and very simple static websites.\n\n## How do I make a site with this?\n\n1. Install `mdiocre` by using the command: `python3 -m pip install mdiocre`.\n\n2. Create a work folder. Let's call it `work`.\n\n3. Make a file called `template.html` inside that folder with these contents:\n   \n   ```\n   <html>\n   <head>Welcome to my website!</head>\n   <body><!--:content--></body>\n   </html>\n   ```\n\n4. Create a folder called `src`, and make a file inside of it called `index.md`, and write anything on it.\n\n5. After your content (or before, it doesn't matter), add: `<!--:mdiocre-template=\"../template.html\"-->`\n\n6. Go back a level to your `work` folder. Assuming Python is present in your PATH (environment variable), create a new text document containing:\n   \n   ```\n   python3 -m mdiocre.interface.cli src build\n   ```\n   \n   Save it inside the folder as a .bat if you're on Windows, or as a .sh if you're on Mac, Linux, or other Unix-like systems. Double click or execute it.\n\n7. Check the `build` folder.\n\n## Variables\n\nMDiocre allows setting variables. These variables are per-page, and can be read by the template. Both the template and the markdown page share the same format for templates - which are HTML comments with the first character after the markup being the colon (:)\n\n**Setting a variable to a string**\n\n```\n<!--: hello = \"test message\" -->\n```\n\nSimply sets `hello` to `test message`. When using a comma, make sure to escape it with \\\\!\n\n**Setting a variable to another variable**\n\n```\n<!--: hello = lemons -->\n```\n\nIf `lemons` is `1` then `hello` will also be `1`. If `lemons` is not set, `hello` will contain the string `lemons`.\n\n**Concatenating two or more variables**\n\n```\n<!--: lemons = hello, hello -->\n```\n\nIf `hello` contains `abc` then `lemons` will contain `abcabc`. However, if you also include a space string in between, like this...\n\n```\n<!-- lemons = hello, \" \", hello -->\n```\n\n`lemons` will contain `abc abc`!\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Static website generator",
    "version": "3.5.3",
    "project_urls": {
        "Homepage": "https://zumi.neocities.org/stuff/mdiocre"
    },
    "split_keywords": [
        "converter",
        "generator",
        "markdown",
        "html",
        "static"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f61a01f5e9ee87764a307006eb639d00eb82ccf6744dd01529e44aec8b7402fa",
                "md5": "055daf35d24a4755078b08fe4863ae5b",
                "sha256": "61e8493d542269cd657563ae478be4d3a206b96bba9521a21352b8c95221f044"
            },
            "downloads": -1,
            "filename": "mdiocre-3.5.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "055daf35d24a4755078b08fe4863ae5b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 23498,
            "upload_time": "2023-07-02T10:32:47",
            "upload_time_iso_8601": "2023-07-02T10:32:47.019294Z",
            "url": "https://files.pythonhosted.org/packages/f6/1a/01f5e9ee87764a307006eb639d00eb82ccf6744dd01529e44aec8b7402fa/mdiocre-3.5.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4c0b7b8fced8c37d1da633554ea438b0cbd764987c30882501ba87a59490ccec",
                "md5": "db79affcf3916d5a1f742194ced0dea8",
                "sha256": "295b1d1a322afa2703a709b590531005ba069f039f4df367ee5f4bbc7aa3cdba"
            },
            "downloads": -1,
            "filename": "mdiocre-3.5.3.tar.gz",
            "has_sig": false,
            "md5_digest": "db79affcf3916d5a1f742194ced0dea8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 22425,
            "upload_time": "2023-07-02T10:32:49",
            "upload_time_iso_8601": "2023-07-02T10:32:49.232781Z",
            "url": "https://files.pythonhosted.org/packages/4c/0b/7b8fced8c37d1da633554ea438b0cbd764987c30882501ba87a59490ccec/mdiocre-3.5.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-02 10:32:49",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "mdiocre"
}
        
Elapsed time: 0.10503s