Skip to content

Commit 20b207f

Browse files
committed
Update ford documentation project file
- new meta data - added TOC - preprocessor macro workaround in json_module.F90 so that USE_UCS4 macro is not expanded in the documentation when unicode is enabled
1 parent 476f8c7 commit 20b207f

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ set ( SKIP_DOC_GEN FALSE CACHE BOOL
145145
if ( NOT SKIP_DOC_GEN )
146146
find_program ( FORD ford )
147147
if ( FORD ) # Found
148+
file ( COPY "${CMAKE_SOURCE_DIR}/media" DESTINATION "${CMAKE_BINARY_DIR}/" )
148149
set ( DOC_DIR "${CMAKE_BINARY_DIR}/doc" )
149150
set ( FORD_PROJECT_FILE "${CMAKE_SOURCE_DIR}/json-fortran.md" )
150151
# Dynamically generate the FORD outputs list

json-fortran.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
11
project: json-fortran
2+
favicon: ./media/json-fortran-32x32.png
23
project_dir: ./src
4+
macro: USE_UCS4
35
output_dir: ./doc
6+
media_dir: ./media
47
project_github: https://github.com/jacobwilliams/json-fortran
58
summary: JSON-FORTRAN -- A Fortran 2008 JSON API
69
author: Jacob Williams
710
github: https://github.com/jacobwilliams
11+
website: http://degenerateconic.com
12+
twitter: https://twitter.com/degenerateconic
813
predocmark_alt: >
914
predocmark: <
1015
docmark_alt:
1116
docmark: !
1217
exclude_dir: tests
1318
exclude_dir: introspection
1419
display: public
15-
display: protected
16-
display: private
20+
protected
21+
private
1722
source: true
23+
md_extensions: markdown.extensions.toc(anchorlink=True)
24+
markdown.extensions.smarty(smart_quotes=False)
25+
26+
<!-- Uncommenting these should work, but this actually causes issues
27+
28+
*[API]: Application Programmable Interface
29+
*[JSON]: JavaScript Object Notation
30+
31+
-->
32+
33+
[TOC]
1834

1935
# Brief description
2036

src/json_module.F90

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
!
77
! This module provides an interface for reading and writing JSON files.
88
!
9-
!@note ```USE_UCS4``` is an optional preprocessor flag.
9+
!@note ```-DUSE_UCS4``` is an optional preprocessor flag.
1010
! When present, Unicode support is enabled. Note that this
1111
! is currently only supported with the gfortran compiler.
1212
! Example: ```gfortran -DUSE_UCS4 ... ```
1313
#ifdef USE_UCS4
14+
# pragma push_macro("USE_UCS4")
15+
# undef USE_UCS4
1416
! The documentation given here assumes ```USE_UCS4``` **is** defined.
17+
# pragma pop_macro("USE_UCS4")
1518
#else
1619
! The documentation given here assumes ```USE_UCS4``` **is not** defined.
1720
#endif

0 commit comments

Comments
 (0)