Skip to content

Example

flywire edited this page Jan 29, 2023 · 7 revisions

This is a short example to demonstrate caption features using MkDocs in Win10.

  1. Navigate to the folder to contain the repository folder and run he following commands to install caption in a virtual environment and start it:

    git clone https://github.com/flywire/caption.git
    cd caption
    py -m venv .venv
    .venv\scripts\activate
    
  2. Follow https://www.mkdocs.org/getting-started/ to install and test MkDocs

    pip install mkdocs
    mkdocs new .
    mkdocs serve
    

    Open http://127.0.0.1:8000/ in your browser, and you'll see the default home page being displayed.

  3. The Caption repository now contains a Docs folder and a mkdocs.yml file with the configuration. Install the local project in editable mode and update the files:

    py -m pip install -e . # project in current directory
    
  4. Replace the following files for the example then serve the documents again and open the site:

    docs\index.md - See #3#issuecomment-660130402

    mkdocs.yml

    site_name: captionTest
    #theme:
    #    name: material
    
    # extra_css: [extra.css]
    
    markdown_extensions:
        - admonition
        - attr_list
        - codehilite
    #    - fenced_code
        - caption:
            captionNumbering: true
    #    - yafg:
    #         figureNumbering: true
    
    nav:
        - Home: index.md
    

    Save the following image as docs\images\gplv3.png

    gplv3

    Sample docs\css files:

Clone this wiki locally