Skip to content

Commit

Permalink
Removed the PDF generation for the library API reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
silvioprog committed Mar 11, 2020
1 parent 68bbb8f commit f42a49f
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 271 deletions.
72 changes: 32 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@ Sagui is a cross-platform C library which helps to develop web servers or framew

# Features

* **Requests processing through:**
* Event-driven - _single-thread + main loop + select/epoll_.
* Threaded - _one thread per request_.
* Thread pool - _thread pool + select/epoll_.
* **High-performance path routing that supports:**
* Regular expressions using [PCRE2](https://www.pcre.org/current/doc/html/pcre2pattern.html) [syntax](https://www.pcre.org/current/doc/html/pcre2syntax.html).
* Just-in-time optimization ([JIT](https://www.pcre.org/current/doc/html/pcre2jit.html)).
* Binary search in path entry-points.
* **HTTP compression:**
* [Deflate](https://en.wikipedia.org/wiki/DEFLATE) for static contents and streams compression.
* [Gzip](https://en.wikipedia.org/wiki/Gzip) for files compression.
* **HTTPS support:**
* TLS 1.3 through [GnuTLS](https://www.gnutls.org) library.
* **Dual stack:**
* Single socket for IPv4 and IPv6 support.
* **Basic authentication:**
* For standard login using *user name/password*.
* **Upload/download streaming by:**
* Payload - for raw data transferring as JSON, XML and other.
* File - for large data transferring as videos, images, binaries and so on.
* **Dynamic strings:**
* Makes it easy strings operations in C.
* **String map:**
* Fast key-value mapping.
* **And more:**
* Fields, parameters, cookies, headers under hash table structure.
* Several callbacks for total library customization.
- **Requests processing through:**
- Event-driven - _single-thread + main loop + select/epoll_.
- Threaded - _one thread per request_.
- Thread pool - _thread pool + select/epoll_.
- **High-performance path routing that supports:**
- Regular expressions using [PCRE2](https://www.pcre.org/current/doc/html/pcre2pattern.html) [syntax](https://www.pcre.org/current/doc/html/pcre2syntax.html).
- Just-in-time optimization ([JIT](https://www.pcre.org/current/doc/html/pcre2jit.html)).
- Binary search in path entry-points.
- **HTTP compression:**
- [Deflate](https://en.wikipedia.org/wiki/DEFLATE) for static contents and streams compression.
- [Gzip](https://en.wikipedia.org/wiki/Gzip) for files compression.
- **HTTPS support:**
- TLS 1.3 through [GnuTLS](https://www.gnutls.org) library.
- **Dual stack:**
- Single socket for IPv4 and IPv6 support.
- **Basic authentication:**
- For standard login using _user name/password_.
- **Upload/download streaming by:**
- Payload - for raw data transferring as JSON, XML and other.
- File - for large data transferring as videos, images, binaries and so on.
- **Dynamic strings:**
- Makes it easy strings operations in C.
- **String map:**
- Fast key-value mapping.
- **And more:**
- Fields, parameters, cookies, headers under hash table structure.
- Several callbacks for total library customization.

# Examples

Expand Down Expand Up @@ -134,25 +134,17 @@ Sagui is released under GNU Lesser General Public License v2.1. Check the [LICEN
# Documentation
The documentation has been written in [Doxygen](https://www.stack.nl/~dimitri/doxygen) and is available in [HTML](https://risoflora.github.io/libsagui-docs/index.html) and [PDF](https://risoflora.github.io/libsagui-docs/ref.html).
# Docker
Official images of Sagui library are available for Linux64 at [Docker Hub](https://hub.docker.com). To use Sagui from containers:
```bash
docker pull risoflora/libsagui
```

or visit the [official repository](https://hub.docker.com/r/risoflora/libsagui) for more information.
The documentation has been written in [Doxygen](https://www.stack.nl/~dimitri/doxygen) and is available in HTML format at [libsagui-docs/index.html](https://risoflora.github.io/libsagui-docs/index.html).
# Downloading
All stable releases are available for download at the [releases page](https://github.com/risoflora/libsagui/releases). For Windows, the packages `libsagui-N.N.N-dll.zip` (and their respective GPG signature) contains the compiled DLLs for 32 and 64 bits. For other systems, the packages `Source code (tar.gz|zip)` contains the library source.
# Building/installing
Check the [BUILD.md](https://github.com/risoflora/libsagui/blob/master/docs/BUILD.md) for instructions to build the library, examples, tests and documentation, then, follow the steps in [INSTALL.md](https://github.com/risoflora/libsagui/blob/master/docs/INSTALL.md) to install the library from sources on your system.
The easiest way to build the library is using a Docker container as builder. Follow the instructions at [libsagui-docker/README.md](https://github.com/risoflora/libsagui-docker/blob/master/README.md) for more details.
Check the [docs/BUILD.md](https://github.com/risoflora/libsagui/blob/master/docs/BUILD.md) for more instructions for how to build the examples, tests, documentation and the library. Also, take a look at [docs/INSTALL.md](https://github.com/risoflora/libsagui/blob/master/docs/INSTALL.md) for how to install the library from sources on your system.
# Compatibility
Expand All @@ -162,7 +154,7 @@ See also [Checking backward API/ABI compatibility of Sagui library versions](htt
# Projects using Sagui
* [Brook framework](https://github.com/risoflora/brookframework) - Pascal framework which helps to develop web applications.
- [Brook framework](https://github.com/risoflora/brookframework) - Pascal framework which helps to develop web applications.
# Contributing
Expand Down
6 changes: 5 additions & 1 deletion cmake/SgCPack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# Cross-platform library which helps to develop web servers or frameworks.
#
# Copyright (C) 2016-2019 Silvio Clecio <[email protected]>
# Copyright (C) 2016-2020 Silvio Clecio <[email protected]>
#
# Sagui library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -70,7 +70,11 @@ if(NOT CPACK_SOURCE_IGNORE_FILES)
"/build/"
"/docs/"
"/lib/"
".clang-format"
".cmake-format"
".editorconfig"
".gitignore"
".markdownlint.json"
".travis.yml"
"_config.yml"
"cmake-build-*")
Expand Down
75 changes: 4 additions & 71 deletions cmake/SgDoxygen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,19 @@
#
# Doxygen variables for the Sagui library documentation generation.
#
# Adds the targets `make html` and `make pdf` to generate respectively the HTML
# and PDF API reference of the Sagui library.
# Adds the targets `make html` to generate the library API reference in
# HTML format.
#
# ::
#
# SG_BUILD_HTML - Enable/disable the API reference generation as HTML.
# SG_BUILD_PDF - Enable/disable the API reference generation as PDF. Note: it
# depends on SG_BUILD_HTML=ON.
# SG_BUILD_MAN_PAGES - Enable/disable the API reference man pages
# generation. Note: it depends on SG_BUILD_HTML=ON.
# SG_GENERATE_HTML - True when enabled the API reference generation as HTML.
# SG_GENERATE_PDF - True when there is the possibility to generating the API
# reference as PDF.
# SG_GENERATE_MAN_PAGES - True when there is the possibility to generating
# the API reference as man pages.
#
# DOXYGEN_FOUND - True when Doxygen executable is found.
# DOXYGEN_INPUT_FILE - Template file used to generate the DOXYGEN_OUTPUT_FILE.
# DOXYGEN_OUTPUT_FILE - Production file to be used as Doxygen input file. It is
# generated from the template DOXYGEN_INPUT_FILE.
# DOXYGEN_DOCS_DIR - Directory containing the documentation in HTML and PDF.
# DOXYGEN_PDFLATEX_EXECUTABLE - The path of the `pdflatex` executable when it
# is found.
# DOXYGEN_MAKEINDEX_EXECUTABLE - The path of the `makeindex` executable when it
# is found.
# DOXYGEN_LATEX_DIR - Directory containing the generated PDF file.
# DOXYGEN_MAN_DIR - Directory containing the generated man page files.

# _
# ___ __ _ __ _ _ _(_)
Expand All @@ -41,7 +27,7 @@
#
# Cross-platform library which helps to develop web servers or frameworks.
#
# Copyright (C) 2016-2019 Silvio Clecio <[email protected]>
# Copyright (C) 2016-2020 Silvio Clecio <[email protected]>
#
# Sagui library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -59,16 +45,13 @@
#

#TODO: Graphviz
#TODO: ePUB

if(__SG_DOXYGEN_INCLUDED OR (NOT CMAKE_BUILD_TYPE MATCHES "[Rr]elease|RELEASE"))
return()
endif()
set(__SG_DOXYGEN_INCLUDED ON)

option(SG_BUILD_HTML "Generate API reference [HTML]" OFF)
option(SG_BUILD_PDF "Generate API reference [PDF]" ${SG_BUILD_HTML})
#option(SG_BUILD_MAN_PAGES "Generate API reference [man pages]" OFF)

if(SG_BUILD_HTML)
find_package(Doxygen QUIET)
Expand All @@ -78,27 +61,6 @@ if(SG_BUILD_HTML)
set(DOXYGEN_INPUT_FILE ${CMAKE_SOURCE_DIR}/doxygen/Doxyfile.in)
set(DOXYGEN_OUTPUT_FILE ${CMAKE_BINARY_DIR}/Doxyfile)
set(DOXYGEN_DOCS_DIR ${CMAKE_BINARY_DIR}/docs)
set(SG_GENERATE_PDF NO)
if(SG_BUILD_PDF)
find_program(DOXYGEN_PDFLATEX_EXECUTABLE pdflatex)
if(DOXYGEN_PDFLATEX_EXECUTABLE)
find_program(DOXYGEN_MAKEINDEX_EXECUTABLE makeindex)
if(DOXYGEN_MAKEINDEX_EXECUTABLE)
set(SG_GENERATE_PDF YES)
else()
message(
WARNING
"makeindex tool is required to generate the API reference PDF")
endif()
else()
message(
WARNING "pdflatex tool is required to generate the API reference PDF")
endif()
endif()
#if(SG_BUILD_MAN_PAGES)
# set(SG_GENERATE_MAN_PAGES YES)
# set(DOXYGEN_MAN_DIR ${DOXYGEN_DOCS_DIR}/man)
#endif()
if(SG_HTTPS_SUPPORT AND GNUTLS_FOUND)
set(SG_HTTPS_SUPPORT_DOC "SG_HTTPS_SUPPORT")
endif()
Expand All @@ -117,37 +79,8 @@ if(SG_BUILD_HTML)
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Generating API reference with Doxygen [HTML]"
VERBATIM)
if(SG_GENERATE_PDF)
set(DOXYGEN_LATEX_DIR ${DOXYGEN_DOCS_DIR}/latex)
add_custom_target(
pdf
COMMAND ${CMAKE_COMMAND} -E chdir ${DOXYGEN_LATEX_DIR}
${CMAKE_BUILD_TOOL}
COMMAND ${CMAKE_COMMAND} -E rename ${DOXYGEN_LATEX_DIR}/refman.pdf
${DOXYGEN_LATEX_DIR}/libsagui-v${VERSION}.pdf
WORKING_DIRECTORY ${DOXYGEN_LATEX_DIR}
COMMENT "Generating API reference with Doxygen [PDF]"
DEPENDS doc
VERBATIM)
endif()
#if(SG_GENERATE_MAN_PAGES)
# find_program(_gzip gzip)
# if(_gzip)
# foreach(_src ${SG_C_SOURCE})
# get_filename_component(_filename ${_src} NAME_WE)
# set(_filename ${DOXYGEN_MAN_DIR}/man3/${_filename}.3)
# add_custom_command(TARGET doc POST_BUILD COMMAND ${_gzip} -f
# ${_filename})
# install(FILES ${_filename}.gz
# DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
# unset(_filename)
# endforeach()
# unset(_gzip)
# endif()
#endif()
else()
message(
WARNING
"Doxygen tool is required to generate the API reference [HTML/PDF]")
WARNING "Doxygen tool is required to generate the library API reference")
endif()
endif()
2 changes: 1 addition & 1 deletion cmake/SgMHD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#
# Cross-platform library which helps to develop web servers or frameworks.
#
# Copyright (C) 2016-2019 Silvio Clecio <[email protected]>
# Copyright (C) 2016-2020 Silvio Clecio <[email protected]>
#
# Sagui library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down
60 changes: 2 additions & 58 deletions cmake/SgSummary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# Cross-platform library which helps to develop web servers or frameworks.
#
# Copyright (C) 2016-2019 Silvio Clecio <[email protected]>
# Copyright (C) 2016-2020 Silvio Clecio <[email protected]>
#
# Sagui library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -115,34 +115,6 @@ else()
set(_build_html "No")
endif()

if(SG_BUILD_PDF AND SG_GENERATE_PDF)
if(_is_release)
set(_build_pdf "Yes")
if(${_build_html} MATCHES "Yes")
if(NOT DOXYGEN_PDFLATEX_EXECUTABLE)
set(_missing_tool "pdflatex")
elseif(NOT DOXYGEN_MAKEINDEX_EXECUTABLE)
set(_missing_tool "makeindex")
endif()
if(_missing_tool)
set(_build_pdf "No (missing tool: ${_missing_tool})")
endif()
else()
set(_build_pdf "No (disabled by \"Build HTML: ${_build_html}\")")
endif()
else()
set(_build_pdf "No (unavailable in build type: ${_build_type})")
endif()
else()
set(_build_pdf "No")
endif()

#if(SG_BUILD_MAN_PAGES AND SG_GENERATE_MAN_PAGES)
# set(_build_man_pages "Yes")
#else()
# set(_build_man_pages "No")
#endif()

if(BUILD_TESTING)
if(_is_debug)
set(_build_testing "Yes")
Expand All @@ -169,31 +141,6 @@ else()
set(_curl "No")
endif()

#message(
# "
#Sagui library ${VERSION} - building summary:
#
# Generator: ${CMAKE_GENERATOR}
# Install: ${CMAKE_INSTALL_PREFIX}
# System: ${_system_name}
# Compiler:
# Executable: ${CMAKE_C_COMPILER}
# Version: ${CMAKE_C_COMPILER_VERSION}
# Machine: ${CMAKE_C_MACHINE}
# CFLAGS: ${_cflags}
# Build: ${_build_type}-${_build_arch} (${_lib_type})
# HTTPS: ${_https_support}
# Compression: ${_http_compression}
# Routing: ${_routing}
# Examples: ${_build_examples}
# Docs:
# HTML: ${_build_html}
# PDF: ${_build_pdf}
# man pages: ${_build_man_pages}
# Run tests: ${_build_testing}
# cURL tests: ${_curl}
#")

message(
"
Sagui library ${VERSION} - building summary:
Expand All @@ -211,9 +158,7 @@ Sagui library ${VERSION} - building summary:
Compression: ${_http_compression}
Routing: ${_routing}
Examples: ${_build_examples}
Docs:
HTML: ${_build_html}
PDF: ${_build_pdf}
Docs: ${_build_html}
Run tests: ${_build_testing}
cURL tests: ${_curl}
")
Expand All @@ -228,6 +173,5 @@ unset(_http_compression)
unset(_routing)
unset(_build_examples)
unset(_build_html)
unset(_build_pdf)
unset(_build_testing)
unset(_curl)
Loading

0 comments on commit f42a49f

Please sign in to comment.