Skip to content

Commit

Permalink
Added mkdocs and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
RhetTbull committed Jan 1, 2023
1 parent 6b266f7 commit 1d3447d
Show file tree
Hide file tree
Showing 29 changed files with 7,746 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ Once you've installed macnotesapp with pipx, to upgrade to the latest version:

**Note**: Currently tested on MacOS 10.15.7/Catalina and 13.1/Ventura.

## Documentation

Full documentation available at [https://RhetTbull.github.io/macnotesapp/](https://RhetTbull.github.io/macnotesapp/)

## Command Line Usage

<!-- [[[cog
Expand Down
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ rm -rf build
echo "Updating README.md"
cog -r README.md

# update docs
echo "Building docs"
mkdocs build

# build the package
echo "Building package"
python3 -m build
Expand Down
6 changes: 6 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Command Line Reference

::: mkdocs-click
:module: macnotesapp.cli
:command: cli_main
:prog_name: notes
24 changes: 24 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Welcome to MacNotesApp

Work with Apple MacOS Notes.app from the command line. Also includes python interface for scripting Notes.app from your own python code. Interactive browsing of notes in a TUI (Terminal User Interface? Textual User Interface?) coming soon!

For full documentation visit [macnotesapp](https://rhettbull.github.io/macnotesapp/).

## Installation

If you just want to use the command line tool, the easiest option is to install via [pipx](https://pypa.github.io/pipx/).

If you use `pipx`, you will not need to create a python virtual environment as `pipx` takes care of this. The easiest way to do this on a Mac is to use [homebrew](https://brew.sh/):

* Open `Terminal` (search for `Terminal` in Spotlight or look in `Applications/Utilities`)
* Install `homebrew` according to instructions at [https://brew.sh/](https://brew.sh/)
* Type the following into Terminal: `brew install pipx`
* Then type this: `pipx install macnotesapp`
* `pipx` will install the `macnotesapp` command line interface (CLI) as an executable named `notes`
* Now you should be able to run `notes` by typing: `notes`

Once you've installed macnotesapp with pipx, to upgrade to the latest version:

pipx upgrade macnotesapp

**Note**: Currently tested on MacOS 10.15.7/Catalina and 13.1/Ventura.
13 changes: 13 additions & 0 deletions docs/strip_rich_markup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
""""Remove rich markup from the given text.
The CLI docstrings use rich markup for pretty-printing help text but this needs to be stripped for serving the docs.
"""
import re

import mkdocs.plugins

mkdocs.plugins.event_priority(-50)


def on_page_content(html, page, config, files, **kwargs):
html = re.sub(r"\[[ib\/][ib]?\]", r"", html)
return html
9 changes: 9 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
site_name: MacNotesApp Docs
site_url: https://rhettbull.github.io/macnotesapp/
markdown_extensions:
- mkdocs-click
nav:
- Home: index.md
- Command Line Reference: cli.md
hooks:
- docs/strip_rich_markup.py
142 changes: 142 additions & 0 deletions site/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">



<link rel="shortcut icon" href="/macnotesapp/img/favicon.ico">
<title>MacNotesApp Docs</title>
<link href="/macnotesapp/css/bootstrap.min.css" rel="stylesheet">
<link href="/macnotesapp/css/font-awesome.min.css" rel="stylesheet">
<link href="/macnotesapp/css/base.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/github.min.css">

<script src="/macnotesapp/js/jquery-1.10.2.min.js" defer></script>
<script src="/macnotesapp/js/bootstrap.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>

<body>
<div class="navbar fixed-top navbar-expand-lg navbar-dark bg-primary">
<div class="container">
<a class="navbar-brand" href="/macnotesapp/.">MacNotesApp Docs</a>
<!-- Expander button -->
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbar-collapse">
<span class="navbar-toggler-icon"></span>
</button>

<!-- Expanded navigation -->
<div id="navbar-collapse" class="navbar-collapse collapse">
<!-- Main navigation -->
<ul class="nav navbar-nav">
<li class="navitem">
<a href="/macnotesapp/." class="nav-link">Home</a>
</li>
<li class="navitem">
<a href="/macnotesapp/cli/" class="nav-link">Command Line Reference</a>
</li>
</ul>

<ul class="nav navbar-nav ml-auto">
<li class="nav-item">
<a href="#" class="nav-link" data-toggle="modal" data-target="#mkdocs_search_modal">
<i class="fa fa-search"></i> Search
</a>
</li>
</ul>
</div>
</div>
</div>

<div class="container">
<div class="row">

<div class="row-fluid">
<div id="main-content" class="span12">
<h1 id="404-page-not-found" style="text-align: center">404</h1>
<p style="text-align: center"><strong>Page not found</strong></p>
</div>
</div>


</div>
</div>

<footer class="col-md-12">
<hr>
<p>Documentation built with <a href="https://www.mkdocs.org/">MkDocs</a>.</p>
</footer>
<script>
var base_url = "/macnotesapp/",
shortcuts = {"help": 191, "next": 78, "previous": 80, "search": 83};
</script>
<script src="/macnotesapp/js/base.js" defer></script>
<script src="/macnotesapp/search/main.js" defer></script>

<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="searchModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="searchModalLabel">Search</h4>
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
</div>
<div class="modal-body">
<p>From here you can search these documents. Enter your search terms below.</p>
<form>
<div class="form-group">
<input type="search" class="form-control" placeholder="Search..." id="mkdocs-search-query" title="Type search term here">
</div>
</form>
<div id="mkdocs-search-results" data-no-results-text="No results found"></div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div><div class="modal" id="mkdocs_keyboard_modal" tabindex="-1" role="dialog" aria-labelledby="keyboardModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="keyboardModalLabel">Keyboard Shortcuts</h4>
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
</div>
<div class="modal-body">
<table class="table">
<thead>
<tr>
<th style="width: 20%;">Keys</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="help shortcut"><kbd>?</kbd></td>
<td>Open this help</td>
</tr>
<tr>
<td class="next shortcut"><kbd>n</kbd></td>
<td>Next page</td>
</tr>
<tr>
<td class="prev shortcut"><kbd>p</kbd></td>
<td>Previous page</td>
</tr>
<tr>
<td class="search shortcut"><kbd>s</kbd></td>
<td>Search</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>

</body>
</html>

0 comments on commit 1d3447d

Please sign in to comment.