8000 Add docs (#17) · reactive-python/reactpy-router@b736c04 · GitHub
[go: up one dir, main page]

Skip to content

Commit b736c04

Browse files
authored
Add docs (#17)
* initial docs + * match * use mkdocs * fix test gh action
1 parent a6f7d23 commit b736c04

File tree

20 files changed

+830
-61
lines changed
  • reactpy_router
  • requirements
  • tests
  • 20 files changed

    +830
    -61
    lines changed

    .github/workflows/test.yaml

    Lines changed: 7 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -1,6 +1,12 @@
    11
    name: Test
    22

    3-
    on: [push]
    3+
    on:
    4+
    push:
    5+
    branches:
    6+
    - main
    7+
    pull_request:
    8+
    branches:
    9+
    - main
    410

    511
    jobs:
    612
    coverage:

    .gitignore

    Lines changed: 4 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,3 +1,7 @@
    1+
    # --- DOCS ---
    2+
    3+
    docs/site
    4+
    15
    # --- JAVASCRIPT BUNDLES ---
    26

    37
    reactpy_router/bundle.js

    README.md

    Lines changed: 1 addition & 57 deletions
    Original file line numberDiff line numberDiff line change
    @@ -2,60 +2,4 @@
    22

    33
    A URL router for ReactPy
    44

    5-
    # Installation
    6-
    7-
    Use `pip` to install this package:
    8-
    9-
    ```bash
    10-
    pip install reactpy-router
    11-
    ```
    12-
    13-
    For a developer installation from source be sure to install [NPM](https://www.npmjs.com/) before running:
    14-
    15-
    ```bash
    16-
    git clone https://github.com/reactive-python/reactpy-router
    17-
    cd reactpy-router
    18-
    pip install -e . -r requirements.txt
    19-
    ```
    20-
    21-
    # Running the Tests
    22-
    23-
    To run the tests you'll need to install [Chrome](https://www.goog 57AE le.com/chrome/). Then you
    24-
    can download the [ChromeDriver](https://chromedriver.chromium.org/downloads) and add it to
    25-
    your `PATH`. Once that's done, simply `pip` install the requirements:
    26-
    27-
    ```bash
    28-
    pip install -r requirements.txt
    29-
    ```
    30-
    31-
    And run the tests with `pytest`:
    32-
    33-
    ```bash
    34-
    pytest tests
    35-
    ```
    36-
    37-
    You can run the tests in headless mode (i.e. without opening the browser):
    38-
    39-
    ```bash
    40-
    pytest tests
    41-
    ```
    42-
    43-
    You'll need to run in headless mode to execute the suite in continuous integration systems
    44-
    like GitHub Actions.
    45-
    46-
    # Releasing This Package
    47-
    48-
    To release a new version of reactpy-router on PyPI:
    49-
    50-
    1. Install [`twine`](https://twine.readthedocs.io/en/latest/) with `pip install twine`
    51-
    2. Update the `version = "x.y.z"` variable in `reactpy-router/__init__.py`
    52-
    3. `git` add the changes to `__init__.py` and create a `git tag -a x.y.z -m 'comment'`
    53-
    4. Build the Python package with `python setup.py sdist bdist_wheel`
    54-
    5. Check the build artifacts `twine check --strict dist/*`
    55-
    6. Upload the build artifacts to [PyPI](https://pypi.org/) `twine upload dist/*`
    56-
    57-
    To release a new version of `reactpy-router` on [NPM](https://www.npmjs.com/):
    58-
    59-
    1. Update `js/package.json` with new npm package version
    60-
    2. Clean out prior builds `git clean -fdx`
    61-
    3. Install and publish `npm install && npm publish`
    5+
    Read the docs: https://reactive-python.github.io/reactpy-router

    docs/mkdocs.yml

    Lines changed: 55 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1,55 @@
    1+
    site_name: ReactPy Router
    2+
    docs_dir: src
    3+
    repo_url: https://github.com/reactive-python/reactpy-router
    4+
    5+
    nav:
    6+
    - Home: index.md
    7+
    - Usage: usage.md
    8+
    - Tutorials:
    9+
    - Simple Application: tutorials/simple-app.md
    10+
    - Custom Router: tutorials/custom-router.md
    11+
    - Reference: reference.md
    12+
    - Contributing: contributing.md
    13+
    - Source Code: https://github.com/reactive-python/reactpy-router
    14+
    15+
    theme:
    16+
    name: material
    17+
    logo: assets/logo.svg
    18+
    favicon: assets/logo.svg
    19+
    palette:
    20+
    # Palette toggle for light mode
    21+
    - scheme: default
    22+
    toggle:
    23+
    icon: material/brightness-7
    24+
    name: Switch to dark mode
    25+
    primary: black
    26+
    accent: light-blue
    27+
    28+
    # Palette toggle for dark mode
    29+
    - scheme: slate
    30+
    toggle:
    31+
    icon: material/brightness-4
    32+
    name: Switch to light mode
    33+
    primary: black
    34+
    accent: light-blue
    35+
    36+
    37+
    plugins:
    38+
    - search
    39+
    - mkdocstrings:
    40+
    default_handler: python
    41+
    handlers:
    42+
    python:
    43+
    paths: ["../"]
    44+
    import:
    45+
    - https://reactpy.dev/docs/objects.inv
    46+
    - https://installer.readthedocs.io/en/stable/objects.inv
    47+
    48+
    markdown_extensions:
    49+
    - admonition
    50+
    - pymdownx.details
    51+
    - pymdownx.superfences
    52+
    53+
    watch:
    54+
    - "../reactpy_router"
    55+

    docs/src/assets/logo.svg

    Lines changed: 160 additions & 0 deletions
    Loading

    docs/src/contributing.md

    Lines changed: 70 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1,70 @@
    1+
    # Contributing
    2+
    3+
    !!! note
    4+
    5+
    The [Code of Conduct](https://github.com/reactive-python/reactpy/blob/main/CODE_OF_CONDUCT.md)
    6+
    applies in all community spaces. If you are not familiar with our Code of Conduct policy,
    7+
    take a minute to read it before making your first contribution.
    8+
    9+
    The ReactPy team welcomes contributions and contributors of all kinds - whether they
    10+
    come as code changes, participation in the discussions, opening issues and pointing out
    11+
    bugs, or simply sharing your work with your colleagues and friends. We’re excited to see
    12+
    how you can help move this project and community forward!
    13+
    14+
    ## Everyone Can Contribute!
    15+
    16+
    Trust us, there’s so many ways to support the project. We’re always looking for people who can:
    17+
    18+
    - Improve our documentation
    19+
    - Teach and tell others about ReactPy
    20+
    - Share ideas for new features
    21+
    - Report bugs
    22+
    - Participate in general discussions
    23+
    24+
    Still aren’t sure what you have to offer? Just [ask us](https://github.com/reactive-python/reactpy-router/discussions) and we’ll help you make your first contribution.
    25+
    26+
    ## Development Environment
    27+
    28+
    For a developer installation from source be sure to install
    29+
    [NPM](https://www.npmjs.com/) before running:
    30+
    31+
    ```bash
    32+
    git clone https://github.com/reactive-python/reactpy-router
    33+
    cd reactpy-router
    34+
    pip install -e . -r requirements.txt
    35+
    ```
    36+
    37+
    This will install an ediable version of `reactpy-router` as well as tools you'll need
    38+
    to work with this project.
    39+
    40+
    Of particular note is [`nox`](https://nox.thea.codes/en/stable/), which is used to
    41+
    automate testing and other development tasks.
    42+
    43+
    ## Running the Tests
    44+
    45+
    ```bash
    46+
    nox -s test
    47+
    ```
    48+
    49+
    You can run the tests with a headed browser.
    50+
    51+
    ```bash
    52+
    nox -s test -- --headed
    53+
    ```
    54+
    55+
    ## Releasing This Package
    56+
    57+
    To release a new version of reactpy-router on PyPI:
    58+
    59+
    1. Install [`twine`](https://twine.readthedocs.io/en/latest/) with `pip install twine`
    60+
    2. Update the `version = "x.y.z"` variable in `reactpy-router/__init__.py`
    61+
    3. `git` add the changes to `__init__.py` and create a `git tag -a x.y.z -m 'comment'`
    62+
    4. Build the Python package with `python setup.py sdist bdist_wheel`
    63+
    5. Check the build artifacts `twine check --strict dist/*`
    64+
    6. Upload the build artifacts to [PyPI](https://pypi.org/) `twine upload dist/*`
    65+
    66+
    To release a new version of `reactpy-router` on [NPM](https://www.npmjs.com/):
    67+
    68+
    1. Update `js/package.json` with new npm package version
    69+
    2. Clean out prior builds `git clean -fdx`
    70+
    3. Install and publish `npm install && npm publish`

    docs/src/index.md

    Lines changed: 18 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1,18 @@
    1+
    # ReactPy Router
    2+
    3+
    A URL router for [ReactPy](https://reactpy.dev).
    4+
    5+
    !!! note
    6+
    7+
    If you don't already know the basics of working with ReactPy, you should
    8+
    [start there](https://reactpy.dev/docs/guides/getting-started/index.html).
    9+
    10+
    ## Installation
    11+
    12+
    Use `pip` to install this package:
    13+
    14+
    ```bash
    15+
    pip install reactpy-router
    16+
    ```
    17+
    18+
    [installer.records][]

    docs/src/reference.md

    Lines changed: 5 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1,5 @@
    1+
    # Reference
    2+
    3+
    ::: reactpy_router.core
    4+
    ::: reactpy_router.simple
    5+
    ::: reactpy_router.types

    docs/src/tutorials/custom-router.md

    Lines changed: 3 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1,3 @@
    1+
    # Custom Router
    2+
    3+
    Under construction 🚧

    0 commit comments

    Comments
     (0)
    0