Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation Instructions - Quarto and Quartodoc #6

Open
mdancho84 opened this issue Sep 20, 2023 · 4 comments
Open

Documentation Instructions - Quarto and Quartodoc #6

mdancho84 opened this issue Sep 20, 2023 · 4 comments

Comments

@mdancho84
Copy link
Contributor

mdancho84 commented Sep 20, 2023

Documentation Instructions

  • Create package documentation (docstrings)
  • Use Quarto and Quartodoc to build the Python package documentation

1. Create Package Documentation

The easiest way to create documentation fast is to use Mintlify Doc Writer for Python

image

IMPORTANT: Quartodoc uses Numpy Docstring Formatting

image

You can then highlight a function and select "Generate Docstring".

image

2. Use Quartodoc & Quarto to generate Package Documentation

Make sure Quarto and Quartodoc are installed.

The main commands are:

# Change directory to /docs folder
cd docs 

# Build the documentation
quartodoc build

# Preview the website
quarto preview

You should now see a website on your localhost:

image

Making Tutorials

We will eventually need to make some tutorials and documentation. Will cover this later after we create the core timetk functions.

Publishing Changes

  • You can just make a pull request with any changes. Once I merge I'll publish.
  • The command is quarto publish gh-pages, which publishes to the gh-pages branch.
@mdancho84
Copy link
Contributor Author

Example of NumPy Style Docstrings

def add_numbers(num1, num2):
    """
    Add two numbers together.
    
    This function takes two numbers, `num1` and `num2`, and returns their sum.
    The numbers can be either integers or floats.
    
    Parameters
    ----------
    num1 : int or float
        The first number to be added.
    num2 : int or float
        The second number to be added.
    
    Returns
    -------
    int or float
        The sum of `num1` and `num2`.
    
    Examples
    --------
    >>> add_numbers(2, 3)
    5
    >>> add_numbers(3.5, 5.5)
    9.0
    
    Notes
    -----
    This is a simple illustrative example and not intended for actual use.
    """
    return num1 + num2

@iskode
Copy link
Collaborator

iskode commented Sep 23, 2023

Hi Matt, I've finished a fresh install on a mew environment. I've found that we need to install notebook before running quatro preview. I do know that it is obvious to have it in our environment as data scientist but just for the sake of specifiying the dependencies.

@machow
Copy link

machow commented Oct 12, 2023

Hey, if you run into any issues at all with quartodoc, don't hesitate to reach out. I'm always happy to clone repos and try building / debugging them, since I want to make sure the doc building process is as painless as possible!

@mdancho84
Copy link
Contributor Author

@machow excellent work on Quartodoc. It's been a breeze to set up good looking and performant documentation.

mdancho84 pushed a commit that referenced this issue Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants