mkdocs | Project documentation with Markdown | Static Site Generator library
kandi X-RAY | mkdocs Summary
kandi X-RAY | mkdocs Summary
Project documentation with Markdown. MkDocs is a fast, simple and downright gorgeous static site generator that's geared towards building project documentation. Documentation source files are written in Markdown, and configured with a single YAML configuration file. It is designed to be easy to use and can be extended with third-party themes, plugins, and Markdown extensions. Please see the Documentation for an introductory tutorial and a full user guide.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Serve a build directory
- Return a relative path to the current working directory
- Start the server
- Runs the build loop
- Deploy the project to GitHub
- Check git version
- Return the host and path for a given remote
- Get the SHA of the current HEAD of the current repo
- Initialize docs
- Run gh - deployment
- Handle data
- Run language search
- Validate the configuration
- Handle opening tags
- Run the validation steps
- Initialize the options
- Returns the destination path
- Draw an edge
- Validate the theme
- Replace URLs with links
- Load a configuration file
- Extract data from a docstring
- Validate config data
- Set edit url
- Handle the request
- Generate search index files
mkdocs Key Features
mkdocs Examples and Code Snippets
# /mkdocs.yml
site_name: Cats API
nav:
- Intro: 'index.md'
- Authentication: 'authentication.md'
- API:
- v1: '!include ./v1/mkdocs.yml'
- v2: '!include ./v2/mkdocs.yml'
plugins:
- monorepo
# /src/v1/mkdocs.yml
site_name: versions/
// js/extra.js
function myMermaidCallbackFunction(id) {
console.log('myMermaidCallbackFunction', id);
plugins:
- mermaid2:
arguments:
theme: dark
mermaid:
callback: ^myMermaidCallbackFunction
extra_javascript:
foo = MyFunctioName
import mermaid2
obj = { "hello": "world",
"barbaz": "^bazbar",
"foo": {"bar": 2},
"bar": True}
s = mermaid2.dumps(obj)
{
hello: "world",
barbaz: bazbar,
foo: {
bar: 2
},
bar: true
}
pip install "mkdocs[i18n] @ git+https://github.com/mkdocs/mkdocs.git"
CONFLICT (rename/delete):
venv/lib/python3.7/site-packages/
astroid/brain/__pycache__/brain_subprocess.cpython-37 2.pyc
deleted in version3ascii and renamed to
venv/lib/python3.7/site-packages/
astroid/brain/brain_subprocess 3.py
in HEAD.
sudo pip3 install mkdocs
sudo pip3 install mkdocs-material
sudo pip3 install matplotlib
mkdocs serve
3. But what about syntax highlighted code?
~~~~ bash
echo "This won't work"
~~~~
from django.views.static import serve
path('static//', serve, {'document_root': settings.STATIC_ROOT, }),
Plan:
Advanced ($150 per month)
Plan Features:
Style your documentation to fit your company's brand
Support custom SSL certificates
Host documentation on your own domain
language: python # Set the build language to Python
python: 3.6 # Set the version of Python to use
branches: master # Set the branch to build from
install:
- pip install mkdocs # Install the required dependencies
script: true # Ski
Community Discussions
Trending Discussions on mkdocs
QUESTION
I was following this tutorial on a Macbook to build a sample Docker image but when I tried to run the following command:
...ANSWER
Answered 2021-Oct-06 at 13:31See its Dockerfile, it uses FROM python:alpine AS base
, which means it used a shared tag. Another word, at the time the document wrote, python:alpine
means maybe python:3.9-alpine
or others.
But now, it means python:3.10-alpine
, see this.
The problems happens at mkdocs
itself, it uses next code:
QUESTION
I try to use this theme plugin to display the graph
Link: https://squidfunk.github.io/mkdocs-material/reference/diagrams/?h=mermaid
the settings file:
...ANSWER
Answered 2022-Mar-12 at 13:10This was part of the insiders offer at your time. If you upgrade your mkdocs-material version it should work.
QUESTION
I have markdown tables like the following in my docs:
...ANSWER
Answered 2022-Feb-15 at 20:25Thanks to the link Waylan provided, I found an unmaintained project that provides what I needed.
I've made a fork of the project (which I intend to maintain), and have published it to PyPI.
QUESTION
I'm using MkDocs to build my documentation.
In my .md
file I have the following content:
ANSWER
Answered 2022-Jan-20 at 17:57Markdown content blocks (for list continuations, source blocks, etc.) require an indent of 4 spaces or 1 tab. See https://www.markdownguide.org/basic-syntax/#adding-elements-in-lists
Either change your two-space indent to 4 spaces, or use tabs.
If you use tabs, you might be able to set the tabstop distance to 2, to preserve the editing experience that you currently have.
QUESTION
I use MKdocs to create a very sensitive documentation, and I want it to be securely available online.
My project is:
- [V] create an encrypted volume on a server (I used veracrypt, cli and python compatibility)
- [V] making a simple page to ask for the key to decrypt
- [V] decrypt the volume
- [X] serve site on flask
- [V] detect session closure and encrypt volume again
(this way there is no persistent clear data on the server)
Documentation gets edited only locally, encrypted and rsynced to server.
Now, I'm blocked on serving site on flask step, because the MKdocs site is structured like this:
...ANSWER
Answered 2022-Jan-22 at 09:32We can consider MkDocs's rendered HTML pages as simple Flask templates. So all we have to do is to create a Flask endpoint that first do the permissions-checking then based on the URL, serves the rendered MkDocs HTML file or a related static file.
Let's call our new endpoint bridge
. First, put everything from MkDocs site
directory to Flask's templates/bridge
directory. My example MkDocs tree looks like this:
QUESTION
I'm trying to upload my first django app and I've been struggle with this issue for sometime, help is appreciated.
I already set up my project to be on heroku, I followed this tutorial: https://www.youtube.com/watch?v=6DI_7Zja8Zc in which django_heroku module is used to configure DB, here is the link to library https://pypi.org/project/django-heroku/
The app throws the error on login as if user tables didn't exist but I already create a super user using the heroku bash feature, after apply migrations using "heroku run python manage.py migrate". When I run "ls" command on heroku bash this is my directory:
manage.py Procfile requirements.txt runtime.txt smoke staticfile
"smoke" is my folder app, should I could see the db in this directory? if the db was not created how could I create a superuser using heroku bash feature?
This is the DB configuration that django gives me on server:
...ANSWER
Answered 2022-Jan-18 at 21:06If you look at the django-heroku
repository on GitHub I think you'll find that it has been abandoned. It has a banner saying
This repository has been archived by the owner. It is now read-only.
and has not had a new commit on the master
branch since October, 2018.
The heroku-on-django
library aims to be an updated replacement for django-heroku
:
This has been forked from django-heroku because it was abandoned and then renamed to django-on-heroku because old project has been archived.
It is also somewhat stagnant (the most recent commit to master
at the time of writing is from October, 2020) but it should work better than django-heroku
.
In either case, make sure to put this at the bottom of your settings.py
as indicated in the documentation:
QUESTION
I'm using mkdocs with material layout and toc markdown extension for adding a toc to the right for a documentation project.
I use up42's wiki as a template for my wiki. I would like to change the title "Table of contents".
The toc markdown documentation provides a parameter "title" that doesn't change anything when used in my mkdocs.yml
:
ANSWER
Answered 2021-Nov-09 at 11:45I didn't find the right parameter or the problem yet, but a simple CSS overset does the job pretty well (thanks to this answer):
QUESTION
I have a documentation site using MkDocs. It contains a list of documents, all with the same basic structure (we only have a list of experimental notebooks). Each notebook (written in a separate MarkDown file) should contain an author + date in the beginning using the following:
...ANSWER
Answered 2021-Nov-28 at 12:11You may want to use metadata
also called frontend
data, as described in the yaml-style-meta-data section. Such information is placed at the beginning of your markdown file. The content can then be used to generate content.
The macro
plugin is made for this and can be found here https://mkdocs-macros-plugin.readthedocs.io
QUESTION
I have this python package located in a github repository. I can install it from the github link directly like so :
...ANSWER
Answered 2021-Oct-15 at 06:07Following example 7 from https://pip.pypa.io/en/stable/cli/pip_install/#examples :
QUESTION
I have a private repository with some pdf files among others. The content is however, made publicly available using MkDocs (material) and github-pages. I want to embed these locally available pdf files on the website (created with MkDocs). So far I have tried this:
...ANSWER
Answered 2021-Sep-22 at 16:10The main challenge in making the pdf file available on the published site is creating a link that is not broken and actually accesses the file from the repository.
Mkdocs comes with a lot of extensions, that enhance the functionality of the framework. You need to use pymdownx.pathconverter
to address this issue.
I have blurred out the contents from the screenshot. But you can see how the embedded pdf file looks like.
Here are the pieces you need to work with.
A. Install PyMdown ExtensionAlong with Other must haves...
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mkdocs
You can use mkdocs like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page