Skip to content

Commit

Permalink
source code docs, README.md and tool manual generation to github pages
Browse files Browse the repository at this point in the history
source code docs, README.md and tool manual generation to github pages
  • Loading branch information
jmspit authored Mar 3, 2021
2 parents 24c748c + 50b4068 commit 1f4ed26
Show file tree
Hide file tree
Showing 6 changed files with 230 additions and 264 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/sourcedoc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish doc

on:
push:
branches:
- master

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Install doxygen graphiz and groff
run: sudo apt-get -f install doxygen graphviz groff


- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build

- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE

- name: Build docs
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: make doc

- name: Deploy docs
uses: JamesIves/github-pages-deploy-action@4.0.0
with:
branch: gh-pages # The branch the action should deploy to.
folder: build/doc # The folder the action should deploy.
34 changes: 22 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@ execute_process(
OUTPUT_VARIABLE GIT_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message( STATUS "GIT_TAG : ${GIT_TAG}")

include( cmake/MunkeiVersionFromGit.cmake )

version_from_git(
LOG ON
TIMESTAMP "%Y%m%d%H%M%S"
)
if( GIT_TAG MATCHES "^v(0|[1-9][0-9]*)[.](0|[1-9][0-9]*)[.](0|[1-9][0-9]*)(-[.0-9A-Za-z-]+).*$" )
set( ${PROJECT}_VERSION_MAJOR "${CMAKE_MATCH_1}" )
set( ${PROJECT}_VERSION_MINOR "${CMAKE_MATCH_2}" )
set( ${PROJECT}_VERSION_PATCH "${CMAKE_MATCH_3}" )
set( ${PROJECT}_VERSION_SNAP "${CMAKE_MATCH_4}" )
else()
message( STATUS "Git tag not valid [${git_tag}]" )
endif()

set( ${PROJECT}_VERSION_MAJOR "${VERSION_MAJOR}" )
set( ${PROJECT}_VERSION_MINOR "${VERSION_MINOR}" )
set( ${PROJECT}_VERSION_PATCH "${VERSION_PATCH}" )
message( STATUS "GIT_TAG : ${GIT_TAG}")

# options
option(EXAMPLE_TEST "set to ON to build examples and tests" "OFF")
Expand All @@ -46,8 +45,8 @@ message( STATUS "CMAKE_CXX_COMPILER : ${CMAKE_CXX_COMPILER}")
message( STATUS "CMAKE_HOST_SYSTEM : ${CMAKE_HOST_SYSTEM}")
message( STATUS "CMAKE_VERSION : ${CMAKE_VERSION}")

set(${PROJECTUC}_VERSION_STR "${SEMVER}")
set(${PROJECT}_VERSION_STR "${SEMVER}")
set(${PROJECTUC}_VERSION_STR "${GIT_TAG}")
set(${PROJECT}_VERSION_STR "${GIT_TAG}")
message( STATUS "${PROJECTUC} BUILD VERSION : ${${PROJECTUC}_VERSION_STR}")
set(${PROJECT}_LIB_NAME "${PROJECT}-${${PROJECT}_VERSION_STR}")
message( STATUS "examples and tests : ${EXAMPLE_TEST}")
Expand Down Expand Up @@ -410,10 +409,21 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT}-config.hpp.in ${CMAKE_CURR
# Doxygen source code documentation
find_package(Doxygen)
if(DOXYGEN_FOUND)
execute_process( COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/doc/doxygen )

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_BINARY_DIR}/doc @ONLY)
configure_file(${CMAKE_CURRENT_BINARY_DIR}/lmon.1 ${CMAKE_CURRENT_BINARY_DIR}/doc @ONLY)


configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT}.doxygen ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mainpage.dox.in ${CMAKE_CURRENT_BINARY_DIR}/mainpage.dox @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
COMMAND cat ${CMAKE_CURRENT_BINARY_DIR}/lmon.1 | groff -Tpdf -man > ${CMAKE_CURRENT_BINARY_DIR}/doc/man_lmon.pdf
COMMAND cat ${CMAKE_CURRENT_BINARY_DIR}/lsys.1 | groff -Tpdf -man > ${CMAKE_CURRENT_BINARY_DIR}/doc/man_lsys.pdf
COMMAND cat ${CMAKE_CURRENT_BINARY_DIR}/lblk.1 | groff -Tpdf -man > ${CMAKE_CURRENT_BINARY_DIR}/doc/man_lblk.pdf
COMMAND cat ${CMAKE_CURRENT_BINARY_DIR}/lard.1 | groff -Tpdf -man > ${CMAKE_CURRENT_BINARY_DIR}/doc/man_lard.pdf
COMMAND cat ${CMAKE_CURRENT_BINARY_DIR}/lrep.1 | groff -Tpdf -man > ${CMAKE_CURRENT_BINARY_DIR}/doc/man_lrep.pdf
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@

Leanux is a C++ API to Linux performance and configuration data and includes a few tools utilizing this API.

The C++ API eases access to system configuration data provided by the `/sysfs` pseudo filesystem, so including CPUs, block devices, network devices and so on. Additionally, the C++ API exposes performance data from the `/proc` pseudo fillesystem.
The C++ API eases access to system configuration data provided by the `/sys` pseudo filesystem, so including CPUs, block devices, network devices and so on. Additionally, the C++ API exposes performance data from the `/proc` pseudo fillesystem.

The (C++) binaries produced by this repository are

| component | purpose |
|------|---------|
| libleanux.so | Shared library backing the leanux C++ API, required by the below tools |
| [lard](https://www.o-rho.com/leanux/lard) | daemon that logs performance and base configuration data to a SQLite database file |
| [lmon](doc/lmon.md) | ncurses (tty) based performance viewer, both real-time and browsing historic data from the lard daemon, with colors, dynamic screen resizing |
| [lrep](https://www.o-rho.com/leanux/lrep) | generates html reports on lard data |
| [lsys](https://www.o-rho.com/leanux/lsys) | command-line tool to retrieve sysfs info for administrative use |
| [lblk](https://www.o-rho.com/leanux/lblk) | command-line tool to retrieve block device and filesystem info for administrative use |
| [labbix](https://www.o-rho.com/leanux/labbix) | Zabbix disk discovery and disk performance statistics for GNU/Linux |

| [lard](man_lard.pdf) | daemon that logs performance and base configuration data to a SQLite database file |
| [lmon](man_lmon.pdf) | ncurses (tty) based performance viewer, both real-time and browsing historic data from the lard daemon, with colors, dynamic screen resizing |
| [lrep](man_lrep.pdf) | generates html reports on lard data |
| [lsys](man_lsys.pdf) | command-line tool to retrieve sysfs info for administrative use |
| [lblk](man_lblk.pdf) | command-line tool to retrieve block device and filesystem info for administrative use |
| labbix | Zabbix disk discovery and disk performance statistics for GNU/Linux |

See [leanux on github pages](https://jmspit.github.io/leanux) for more documentation. If you are on github pages now,
you can view the doxygen code documentation as [here](doxygen/html/index.html), and the links in the above table will link to pdf documents.
## Building from source

Builds should work on any Linux host that satisfies
Expand Down
167 changes: 0 additions & 167 deletions cmake/MunkeiVersionFromGit.cmake

This file was deleted.

Loading

0 comments on commit 1f4ed26

Please sign in to comment.