Skip to content

Commit

Permalink
Updated readme for tags / development notes
Browse files Browse the repository at this point in the history
  • Loading branch information
Hecatron committed Aug 22, 2020
1 parent 529e039 commit cfb23cf
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 11 deletions.
28 changes: 28 additions & 0 deletions Development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Development

## Plugins

The plugins in use include

* [Material Theme for mkdocs](https://squidfunk.github.io/mkdocs-material/)
* [MkdocsTagPlugin - Support for Tags](https://github.com/srymh/MkdocsTagPlugin)

## Build System

For most folks they only want to add pages or images via Github so are not interested in how the main page is built.
However for those interested the documentation pages are built into a site using mkdocs and the mkdocs material theme using a ci script
[.github/workflows/ci.yml](.github/workflows/ci.yml)

This is typically automatic as soon as a new commit is pushed

### Manual Build

If you want to experiment manually building the documentation for experimenting with plugins etc.
There's a script in the root directory called **build.py** which can be used with python 3.8 / mkdocs / mkdocs material / any other plugins required.
There's also a **virtenv** directory that can be used to setup a virtual python environment.

To have the site built locally and visible on [http://127.0.0.1:8000] on your own machine
You can ether run

* build.py serve
* mkdocs serve --livereload
34 changes: 24 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,35 @@
# Documentation

This repo contains the official documentation for Hackspace Manchester.

All members can push edits or new documentation to this repo and it will automatically build and will be available at https://docs.hacman.org.uk

This uses Github Actions and MKDocs

## Build Process
The syntax in use is markdown, for editing pages it is suggested to use an online markdown editor such as
https://stackedit.io/app#

## Tags

### Automated Build
This repo now has support for tags within the documentation.
To add a tag to a page as an example

For most folks they only want to add pages or images via Github so are not interested in how the main page is built.
However for those interested the documentation pages are built into a site using mkdocs and the mkdocs material theme using a ci script
[.github/workflows/ci.yml](.github/workflows/ci.yml)
Add something like this to the top of the page to add a tag
**docs/Tools_Equipment/Wood_Working/Table_Saw_ts2500.md**
```
---
tags:
- Equipment
---
```

## Manual Build
Next if the Tag is a new tag we need to create a page for it
to show all pages that are a member of this tag
**docs/tags/Equipment.md**
```
---
pagetype: tagpage
---
If you want to experiment manually building the documentation for experimenting with plugins etc. There's a script in the root directory called **build.py** which can be used with python 3.8 / mkdocs / mkdocs material / any other plugins required.
# Tag: Equipment
There's also a **virtenv** directory that can be used to setup a virtual python environment.
Equipment related pages
```
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def publish(self):

def serve(self):
print("Starting MkDocs Server http://127.0.0.1:8000")
cmdopts = ["mkdocs", "serve"]
cmdopts = ["mkdocs", "serve", "--livereload"]
self.run_cmd(cmdopts, self.MKDOCSDIR)
print ("Server Closed.")

Expand Down

0 comments on commit cfb23cf

Please sign in to comment.