Giter VIP home page Giter VIP logo

developer-documentation-new's Introduction

Documentation Status

All Contributors

Open in Gitpod

Mautic developer documentation (new)

This repository hosts the new developer documentation for Mautic on the Read the Docs platform. Whenever a PR is merged, changes are deployed immediately to https://mautic-developer.readthedocs.io/

If you're looking for the legacy developer documentation, please go to https://developer.mautic.org/ or the GitHub repository.

Migration of developer docs to 'Read the Docs'

The aim is to move all aspects of the developer documentation to Read the Docs (with the exception of the REST API documentation). In the video below, @dennisameling explains how the documentation is currently structured and briefly touches upon current limitations.

For more background, the end goal, and if you want to help, please see this issue. Thanks in advance.

Link to YouTube video with explanation of the current developer documentation structure

Adding a code sample

Code samples get downloaded from GitHub to ensure that they're always up to date. If you want to add a new code sample, follow these two steps:

  1. Create a file in docs/code_samples/ and add a permalink in there. Look at other files in that directory for examples. URLs should always start with https://raw.githubusercontent.com/... to ensure that Sphinx can download the file correctly.
  2. In any documentation file, add a literalinclude block to include the code, like so:
.. The link to this file is defined in docs/code_samples/helloworld_entity_world.py 
.. literalinclude:: ../code_samples_downloaded/Entity_World.php
    :language: php

Tip: downloaded files get cached in docs/code_samples_downloaded to prevent overloading GitHub with download requests. If you change the URL to a file, simply remove the cached file from docs/code_samples_downloaded and Sphinx automatically re-downloads it.

Build documentation locally

The following provides instructions for how to build docs locally for visualization without pushing to the remote:

  1. Install Python 3 for your OS if not already installed
  2. Install Sphinx pip install sphinx
  3. Install sphinx-rtd-theme pip install sphinx-rtd-theme
  4. CD into the docs directory cd [path to this repo]/docs
  5. Run make html
  6. This generates HTML in docs/build/html. Setup a web server with the web root as docs/build/html or open docs/build/html/index.html in a browser.

Troubleshooting

If the build isn't working for some reason, here's some tips:

  • Try running the make html command in the terminal: cd docs && make html. This command normally provides a lot of additional context.
  • If the preview isn't working, click the esbonio section in the bottom right corner of the VS Code window. That rebuilds the docs and previews, and tells you if something is wrong.

Vale

Before pushing, run Vale and address suggestions and errors as applicable.

  1. Install vale
  2. vale .

PhpStorm & PyCharm file watcher

You can automatically build changes to .rst files using a file watcher.

  1. Go to Preferences -> Tools -> File Watchers -> + button -> custom
  2. Configure the watcher as presented in the screenshot

Screen Shot 2021-10-06 at 15 52 06

Style guide

Please consult Mautic's style-guide before contributing to the documentation. Some rules get enforced through Vale.

As a quick reference, here's the list of headings Mautic uses:

H1: ############
H2: ****************
H3: ============
H4: ----------------
H5: ~~~~~~~~~~~~

Converting markdown to reStructuredText

Mautic's documentation uses reStructuredText, or .rst files. Luckily, there's converters available that help you convert .md to .rst files. Here's an example of m2r - this converter also converts tables into list-table directives properly.

pip install m2r
# This creates a new file with the .rst extension:
m2r my_markdown_file.md

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

Robert Parker
Robert Parker

๐Ÿ“–
Rahul Shinde
Rahul Shinde

๐Ÿ“–
Dennis Ameling
Dennis Ameling

๐Ÿ“– ๐Ÿ‘€

This project follows the all-contributors specification. Contributions of any kind welcome.

developer-documentation-new's People

Contributors

alanhartless avatar rcheesley avatar dennisameling avatar shinde-rahul avatar nick-vanpraet avatar dependabot[bot] avatar lenonleite avatar escopecz avatar allcontributors[bot] avatar mabumusa1 avatar roboparker avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.