Skip to content

Commit

Permalink
Implement mdBook to publish docs
Browse files Browse the repository at this point in the history
- Add book.toml to hold settings for book
- Restructure docs folder for mdBook
- Remove `help` section from Makefile
- Update references to docs location
- Add github action to publish docs to gh pages
  • Loading branch information
dmtrek14 committed Jul 31, 2023
1 parent 44bd16c commit fbc696c
Show file tree
Hide file tree
Showing 84 changed files with 77 additions and 31 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Documentation

on:
push:
branches:
- main
pull_request:

jobs:
deploy:
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v2

- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: 'latest'

- run: cd docs && mdbook build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/book
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*~
\#*\#

#compiled help files
help/*
#compiled docs
docs/book

#release tarballs
phpreport*.tar.gz
Expand Down
29 changes: 0 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,6 @@ zip: tgz
VERSION=`./version.sh`; \
tar tf phpreport_$${VERSION}.tar.gz | zip -@ phpreport_$${VERSION}.zip

help:
#create dirs
mkdir -p help/user
mkdir -p help/admin
mkdir -p help/developer
#copy images
cp -r docs/user/i help/user
cp -r docs/developer/i help/developer
#generate footer
echo -ne '\n.. class:: credits\n\n This file is part of PhpReport ' > footer
VERSION=`./version.sh`; echo -ne $${VERSION} >> footer
echo -e ' documentation.' >> footer
echo -ne ' Generated on ' >> footer
date >> footer
#parse rst
for i in `find -name *.rst -not -path "*vendor/*"` ; do \
#rename .rst for .html in links to other doc pages \
sed 's/\.rst/\.html/g' $$i > tmp; \
#append footer \
cat footer >> tmp; \
#extract file name to be used as the output file name \
FILE=`echo $$i | awk '{firstpart=substr($$i, 8);x=index(firstpart,".rst");print substr(firstpart, 1,x)}'`; \
#generate html file \
rst2html tmp help/$${FILE}html; \
done
rm tmp
rm footer

minify:
# WARNING: this will remove any unstaged changes! Do not run on a development directory
Expand All @@ -61,5 +34,3 @@ minify:
done
rm tmp

#prevent makefile docs are up-to-date
.PHONY: help
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[![Test](https://github.com/Igalia/phpreport/actions/workflows/runtests.yml/badge.svg)](https://github.com/Igalia/phpreport/actions/workflows/runtests.yml)

[![Documentation](https://github.com/Igalia/phpreport/actions/workflows/publish-docs.yml/badge.svg)](https://github.com/Igalia/phpreport/actions/workflows/publish-docs.yml)

# PhpReport

PhpReport is a web application for time tracking, which provides useful
Expand Down
12 changes: 12 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[book]
authors = ["Igalia"]
language = "en"
multilingual = false
title = "PhpReport Documentation"
description = "Time tracking and project management"
src = "docs"

[output.html]
theme = "theme"
git-repository-icon = "fa-git"
git-repository-url = "https://github.com/Igalia/phpreport"
3 changes: 3 additions & 0 deletions docs/src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# PhpReport Introduction

> ⚠️ Please note that we are in the process of rewriting PhpReport. We are trying to keep up with updating the documentation, but there may be some pages that remain in flux during the rewrite.
29 changes: 29 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Summary

[Introduction](README.md)

- [Developer Documentation](./developer/index.md)
- [Setting up a development environment](./developer/devel-setup.md)
- [Overview](./developer/overview.md)
- [Data model](./developer/data-model.md)
- [Data access layer](./developer/data-access-layer.md)
- [API](./developer/api.md)
- [User interface](./developer/user-web-interface.md)
- [Business logic layer and plugin system](./developer/business-logic-layer.md)
- [Web service layer](./developer/web-service-layer.md)
- [User Documentation](./user/index.md)
- [Overview](./user/overview.md)
- [Tasks Management](./user/tasks.md)
- [Reports](./user/reports.md)
- [Projects Management](./user/projects-management.md)
- [User Management](./user/users-management.md)
- [Client Management](./user/clients-management.md)
- [Cities and work calendars](./user/cities-calendars-management.md)
- [Management of Other Entities](./user/other-management.md)
- [Application settings](./user/settings-management.md)
- [Administrator Documentation](./admin/index.md)
- [Installation instructions](./admin/installation.md)
- [Installing in Docker](./admin/docker.md)
- [Upgrade instruction](./admin/upgrade.md)
- [How to set up LDAP authentication](./admin/ldap.md)
- [Common Problems](./admin/common-problems.md)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit fbc696c

Please sign in to comment.