Skip to content

Commit a580744

Browse files
committed
Merge pull request #1499 from UncleGrumpy/fix-publish-docs
Changes to reduce the size of published documentation on GitHub Pages These changes take the first steps necessary to remove older and pre-release versions from the published documentation by removing these versions form the navigation menu. This directs users to recent stable releases, and helps keep the published pages below the 1 GB limit for GitHub hosted Pages branches. Note: the old documentation versions will be removed from the atomvm_www Production branch in a PR to that repo. Minor adjustment to graphics format from png to svg to keep sizes smaller and render better on a wider variety of browsers, and improve the quality of the PDF ans epub documents. Changes to where build artifacts are created to keep them from polluting the published content and consuming unnecessary space. Adds a missing check for doxgen before attempting to build the documentation. These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents 426d9a1 + e6499cb commit a580744

File tree

5 files changed

+45
-7
lines changed

5 files changed

+45
-7
lines changed

.github/workflows/publish-docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ jobs:
129129
git add "doc/${{ github.ref_name }}"
130130
git add .
131131
git diff --exit-code Production || echo "Going to commit"
132-
git diff --exit-code Production || git commit -m "Update Documentation"
132+
git diff --exit-code Production || git commit -m "Update Documentation for ${{ github.ref_name }}"
133133
git log -1
134134
- name: Push changes
135135
if: github.repository == 'atomvm/AtomVM'

CMakeModules/FindDoxygen.cmake

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# This file is part of AtomVM.
3+
#
4+
# Copyright 2021 Fred Dushin <fred@dushin.net>
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
19+
#
20+
21+
find_program(DOXYGEN_PATH doxygen)
22+
23+
if (DOXYGEN_PATH)
24+
set(DOXYGEN_FOUND TRUE)
25+
set(DOXYGEN_BUILD_EXECUTABLE "${DOXYGEN_PATH}")
26+
elseif(DOXYGEN_FIND_REQUIRED)
27+
message(FATAL_ERROR "Doxygen command (doxygen) not found")
28+
endif()

doc/CMakeLists.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,27 +126,30 @@ endif()
126126
##
127127
find_package(Sphinx)
128128
if(SPHINX_FOUND)
129+
find_package(Doxygen)
130+
if(DOXYGEN_FOUND)
131+
message("Doxygen found: ${DOXYGEN_BUILD_EXECUTABLE}")
129132
message("Sphinx found: ${SPHINX_BUILD_EXECUTABLE}")
130133
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
131134
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/pdf_stylesheet.rts DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
132135
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/pdf_template.rtt DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
133136
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/apidocs/libatomvm)
134137
add_custom_target(sphinx-html
135-
${SPHINX_BUILD_EXECUTABLE} -q -b html -c ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src/ ${CMAKE_CURRENT_BINARY_DIR}/html/
138+
${SPHINX_BUILD_EXECUTABLE} -q --doctree-dir ${CMAKE_CURRENT_BINARY_DIR}/doctree -b html -c ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src/ ${CMAKE_CURRENT_BINARY_DIR}/html/
136139
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
137140
COMMENT "Generating Sphinx HTML documentation" VERBATIM
138141
DEPENDS ${DOTFILE_TARGETS} ${ERLANG_EDOC_TARGETS}
139142
)
140143

141144
add_custom_target(sphinx-pdf
142-
${SPHINX_BUILD_EXECUTABLE} -q -D exclude_patterns=apidocs/libatomvm/** -b rinoh -c ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src/ ${CMAKE_CURRENT_BINARY_DIR}/pdf/
145+
${SPHINX_BUILD_EXECUTABLE} -q --doctree-dir ${CMAKE_CURRENT_BINARY_DIR}/doctree -D exclude_patterns=apidocs/libatomvm/** -b rinoh -c ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src/ ${CMAKE_CURRENT_BINARY_DIR}/pdf/
143146
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
144147
COMMENT "Generating Sphinx PDF documentation" VERBATIM
145148
DEPENDS ${DOTFILE_TARGETS} ${ERLANG_EDOC_TARGETS}
146149
)
147150

148151
add_custom_target(sphinx-epub
149-
${SPHINX_BUILD_EXECUTABLE} -q -D exclude_patterns=apidocs/libatomvm/**,LICENSES/** -b epub -c ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src/ ${CMAKE_CURRENT_BINARY_DIR}/epub/
152+
${SPHINX_BUILD_EXECUTABLE} -q --doctree-dir ${CMAKE_CURRENT_BINARY_DIR}/doctree -D exclude_patterns=apidocs/libatomvm/**,LICENSES/** -b epub -c ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src/ ${CMAKE_CURRENT_BINARY_DIR}/epub/
150153
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
151154
COMMENT "Generating Sphinx EPub documentation" VERBATIM
152155
DEPENDS ${DOTFILE_TARGETS} ${ERLANG_EDOC_TARGETS}
@@ -162,6 +165,9 @@ if(SPHINX_FOUND)
162165
)
163166
endif()
164167

168+
else()
169+
message("Unable to find Doxygen -- no Sphinx documentation will be generated")
170+
endif()
165171
else()
166172
message("Unable to find Sphinx -- no Sphinx documentation will be generated")
167173
endif()

doc/Doxyfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2304,7 +2304,7 @@ DIRECTORY_GRAPH = YES
23042304
# The default value is: png.
23052305
# This tag requires that the tag HAVE_DOT is set to YES.
23062306

2307-
DOT_IMAGE_FORMAT = png
2307+
DOT_IMAGE_FORMAT = svg
23082308

23092309
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
23102310
# enable generation of interactive SVG images that allow zooming and panning.

doc/conf.py.in

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ extensions = [
6060
'sphinx.ext.graphviz'
6161
]
6262

63+
graphviz_output_format = 'svg'
64+
6365
suppress_warnings = [
6466
'epub.unknown_project_files',
6567
'misc.highlighting_failure',
@@ -167,9 +169,11 @@ tag_list = sorted(repo.tags, key=lambda t: t.commit.committed_datetime)
167169
latest_tag = tag_list[-1]
168170
versions = list()
169171
release_list = list()
172+
omit_tag_list = [ 'v0.6.0-alpha.0', 'v0.6.0-alpha.1', 'v0.6.0-alpha.2', 'v0.6.0-beta.0', 'v0.6.0-beta.1', 'v0.6.0-rc.0' ]
170173
for tag in tag_list:
171-
versions.append(tag.name)
172-
release_list.append(tag.name)
174+
if tag.name not in omit_tag_list:
175+
versions.append(tag.name)
176+
release_list.append(tag.name)
173177

174178
omit_branch_list = [ 'release-0.5' ]
175179
branch_list = sorted(repo.branches, key=lambda t: t.commit.committed_datetime)

0 commit comments

Comments
 (0)