{ "info": { "author": "Bruno Bord", "author_email": "bruno@jehaisleprintemps.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Static Markdown\n\nA static web server with markdown rendering feature.\n\nIt serves regular HTTP content (HTML, JS, CSS, images, etc), but when you're browsing a ``.md``, ``.mdown`` or ``.markdown`` file, it's converted into HTML and rendered as a (hopefully) readable page.\n\n## IMPORTANT WARNING\n\n**This server is not recommended for production. It's a toy to serve static files and Markdown content, but there's no guarantee about security, performance, availability, etc.**\n\n## Installation\n\n### via PyPI\n\nInstall this tool using pip to download it [from PyPI](https://pypi.org/project/static-markdown/). You may prefer to use a virtualenv, but you may also want to install \"user-wide\".\n\n```shell\npip install static-markdown\npip install --user static-markdown\n```\n\n### Using the source\n\nWe're advising you to use ``virtualenv`` to install this package. Clone this repository, and, inside your *virtualenv*, run the following:\n\n```shell\npip install -e ./\n```\n\n## Usage\n\nOnce it's installed, you can just change your current shell session to the designated directory and run the following:\n\n```shell\ncd /path/to/directory\nserve-md\n```\n\nAlternatively, you can also run this command line from anywhere, but set the target path as a command argument:\n\n```shell\nserve-md /path/to/directory\n```\n\nUsing these default option, you can now browse your \"static website\" by pointing your browser to: .\n\nStop the server with Ctrl-C.\n\n### Options\n\n```\nusage: serve-md [-h] [-p PORT] [--markdown-template MARKDOWN_TEMPLATE]\n [--stylesheet STYLESHEET] [--version]\n [root]\n\npositional arguments:\n root Path to serve statically\n\noptional arguments:\n -h, --help show this help message and exit\n -p PORT, --port PORT Port number (0-65535)\n --markdown-template MARKDOWN_TEMPLATE\n Path to an alternate HTML template for Markdown files\n --stylesheet STYLESHEET\n Path to a custom stylesheet\n --version Return version and exit\n```\n\n### Browsing\n\nLet's consider the following path tree:\n\n```\n.\n\u251c\u2500\u2500 empty\n\u251c\u2500\u2500 images\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 knight.png\n\u251c\u2500\u2500 index.html\n\u251c\u2500\u2500 mdown\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 index.md\n\u251c\u2500\u2500 mdown-readme\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 README.md\n\u2514\u2500\u2500 subdir\n \u2514\u2500\u2500 index.html\n```\n\nHere is a table describing the different pages rendered with the given URL in your browser\n\n| URL | Content | Content type | Status Code |\n|:-------------------|:-----------------------|:-------------|:----------------------|\n| / | index.html | text/html | 200 OK |\n| /empty | directory listing | text/html | 200 OK |\n| /images/knight.png | knight.png (as binary) | image/png | 200 OK |\n| /mdown/ | index.md (as HTML) | text/html | 200 OK |\n| /mdown/index.md | index.md (as HTML) | text/html | 200 OK |\n| /mdown-readme | README.md (as HTML) | text/html | 200 OK |\n| /subdir | redirect to /subdir/ | - | 301 MOVED PERMANENTLY |\n| /subdir/ | subdir/index.html | text/html | 200 OK |\n\n### Indexes\n\nWhen browsing a directory, ``serve-md`` will look after the following files, in that specific order: \"index.html\", \"index.htm\", \"index.md\", \"README.md\", \"readme.md\". The first one of them to be found will be served as the index page of the directory.\n\nIf none of them is found, ``serve-md`` will return a directory listing. If you're using the \"Markdown template\" feature, it'll be used when rendering this page.\n\n### HTTP Verbs\n\nGET & HEAD verbs are implemented.\n\nPOST, PUT, DELETE will result into a 405 Method Not Allowed error.\n\n### Markdown templates\n\nBy default, Markdown files will be rendered as HTML using a minimal CSS. Using the ``--markdown-template`` option, you can use your own HTML template with a custom CSS to render generate the ``text/html``. You can find various examples in the ``example-options`` directory in the source repository.\n\nWe've used various minimalist CSS frameworks for rendering and layout:\n\n* [miligram](https://milligram.io/),\n* [mini css](https://minicss.org/),\n* [Github Markdown CSS](https://github.com/sindresorhus/github-markdown-css),\n\n### Custom styles\n\nIf the only thing you need is to customize styles, but not the structure of your HTML page, you can use the ``--stylesheet`` option to point at a CSS file.\n\nExample:\n\n```sh\nserve-md /path/to/directory --stylesheet ~/my-style.css\n```\n\n## Hack\n\n1. Clone this repository.\n2. Write tests.\n3. Implement stuff.\n4. Open a Pull Request.\n\n**Important:** Each time you're modifying any line of the server's code, if you want to test your patch **live**, you **HAVE** to stop and restart the application.\n\n### Run automated tests\n\nIn a shell session, run tests with:\n\n```shell\nmake test\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/brunobord/static-markdown", "keywords": "web static markdown", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "static-markdown", "package_url": "https://pypi.org/project/static-markdown/", "platform": "any", "project_url": "https://pypi.org/project/static-markdown/", "project_urls": { "Homepage": "https://github.com/brunobord/static-markdown" }, "release_url": "https://pypi.org/project/static-markdown/0.3.0/", "requires_dist": null, "requires_python": ">= 3.6", "summary": "A static web server with markdown rendering feature", "version": "0.3.0" }, "last_serial": 5931604, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "e3619a58645b272ab6388260f1fe5e72", "sha256": "bf08da039e156a9603777ee139f807699ccdab314006d2c5cbc0a7adea6cc1aa" }, "downloads": -1, "filename": "static_markdown-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e3619a58645b272ab6388260f1fe5e72", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">= 3.6", "size": 7928, "upload_time": "2019-06-13T20:02:49", "url": "https://files.pythonhosted.org/packages/f5/f0/9b2cea7cac563ef71bcd930f159963e30d0608c242ac895e47f61acc5cd8/static_markdown-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2327e9241a241628b44ca2f9f4056306", "sha256": "335566a11ad13db394eab49580ce7d8c05fd4894af9a96477c2db916f0dcb2aa" }, "downloads": -1, "filename": "static-markdown-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2327e9241a241628b44ca2f9f4056306", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 6883, "upload_time": "2019-06-13T20:02:52", "url": "https://files.pythonhosted.org/packages/6a/c7/a93e3d7a8d21564a51a4c4ea9465cec467004f7dd842587c4771900b1591/static-markdown-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "e556bc34d93b9397f3899800fb5b1b65", "sha256": "d059f9471cba3b6c12bd8da372eb28f096adba5603395c31f2a8b9add9bc3de9" }, "downloads": -1, "filename": "static_markdown-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e556bc34d93b9397f3899800fb5b1b65", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">= 3.6", "size": 9125, "upload_time": "2019-06-19T20:16:16", "url": "https://files.pythonhosted.org/packages/b3/ef/6ce19580f5729f55c424406693027bddd3e2dcc3669d60369980c4cfc3f7/static_markdown-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0c1299ef613bffa9cf7db0b776177652", "sha256": "5e4c567df7e98b0fcef79b9b5d45c3d0b88faf181e7ea6bf4c40276beb3e6be1" }, "downloads": -1, "filename": "static-markdown-0.2.0.tar.gz", "has_sig": false, "md5_digest": "0c1299ef613bffa9cf7db0b776177652", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 7861, "upload_time": "2019-06-19T20:16:18", "url": "https://files.pythonhosted.org/packages/75/88/467ef0670ed44d9513423ee85b9561a2ee0e94af93c902de37e6fb88ad50/static-markdown-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "91c305cf4f3fa6f9310a74fd83d3aa39", "sha256": "ccc3792a3b5f0f717899e2f69a45ffc69443c940f850d68d9e928915fd876cf6" }, "downloads": -1, "filename": "static_markdown-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "91c305cf4f3fa6f9310a74fd83d3aa39", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">= 3.6", "size": 9629, "upload_time": "2019-10-05T10:11:29", "url": "https://files.pythonhosted.org/packages/86/13/b315e81152796a26aaa439773b0cae57622347003031ee4fef1d6b6f3e7d/static_markdown-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cca9752afc7a4152ce8af33d59ac30e8", "sha256": "89df1795aac4672963bb92776aefa542ace84a0d86f413092343228ed5240931" }, "downloads": -1, "filename": "static-markdown-0.3.0.tar.gz", "has_sig": false, "md5_digest": "cca9752afc7a4152ce8af33d59ac30e8", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 8401, "upload_time": "2019-10-05T10:10:42", "url": "https://files.pythonhosted.org/packages/61/62/429bf2df69eecfdf05bd16f1bd7b156146cec0988166e11572ca38e9fd51/static-markdown-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "91c305cf4f3fa6f9310a74fd83d3aa39", "sha256": "ccc3792a3b5f0f717899e2f69a45ffc69443c940f850d68d9e928915fd876cf6" }, "downloads": -1, "filename": "static_markdown-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "91c305cf4f3fa6f9310a74fd83d3aa39", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">= 3.6", "size": 9629, "upload_time": "2019-10-05T10:11:29", "url": "https://files.pythonhosted.org/packages/86/13/b315e81152796a26aaa439773b0cae57622347003031ee4fef1d6b6f3e7d/static_markdown-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cca9752afc7a4152ce8af33d59ac30e8", "sha256": "89df1795aac4672963bb92776aefa542ace84a0d86f413092343228ed5240931" }, "downloads": -1, "filename": "static-markdown-0.3.0.tar.gz", "has_sig": false, "md5_digest": "cca9752afc7a4152ce8af33d59ac30e8", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 8401, "upload_time": "2019-10-05T10:10:42", "url": "https://files.pythonhosted.org/packages/61/62/429bf2df69eecfdf05bd16f1bd7b156146cec0988166e11572ca38e9fd51/static-markdown-0.3.0.tar.gz" } ] }