Skip to content

Commit 7c87e04

Browse files
committed
2 parents 8042f25 + a18f026 commit 7c87e04

File tree

11 files changed

+1211
-3169
lines changed

11 files changed

+1211
-3169
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
bin/
22
lib/
33
builds/
4+
doc/
45
*.mod
56
*.o
67
*.obj

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ env:
1212
# CMake build with unit tests, no documentation, with coverage analysis
1313
# No unicode so that coverage combined with the build script will cover unicode
1414
# and non-unicode code paths
15-
- BUILD_SCRIPT="mkdir cmake-build && cd cmake-build && cmake -DSKIP_DOC_GEN:BOOL=TRUE -DCMAKE_BUILD_TYPE=COVERAGE .. && make -j 4 check"
15+
- BUILD_SCRIPT="mkdir cmake-build && cd cmake-build && cmake -DCMAKE_BUILD_TYPE=COVERAGE .. && make -j 4 check"
1616
SPECIFIC_DEPENDS="cmake nodejs"
1717
JLINT="yes"
18-
DOCS="no"
18+
DOCS="yes"
1919
FoBiS="no"
2020
CODE_COVERAGE="yes"
2121

@@ -41,7 +41,6 @@ before_install:
4141
- if [[ $JLINT == [yY]* ]]; then curl -sL https://deb.nodesource.com/setup | sudo bash -x - ; fi
4242
- if [[ $CHECK_README_PROGS == [yY]* ]]; then wget http://people.sc.fsu.edu/~jburkardt/f_src/f90split/f90split.f90; fi
4343
- if [[ $DOCS == [yY]* ]]; then export DEPENDS="$DEPENDS exuberant-ctags"; fi
44-
- if [[ $DOCS == [yY]* ]]; then wget http://launchpadlibrarian.net/70968359/robodoc_4.99.41-1_amd64.deb; fi
4544
- ulimit -s unlimited
4645

4746
install:
@@ -50,7 +49,7 @@ install:
5049
- sudo ln -fs /usr/bin/gfortran-4.9 /usr/bin/gfortran && gfortran --version
5150
- sudo ln -fs /usr/bin/gcov-4.9 /usr/bin/gcov && gcov --version
5251
- if [[ $FoBiS == [yY]* ]]; then sudo -H pip install FoBiS.py && FoBiS.py --version; fi
53-
- if [[ $DOCS == [yY]* ]]; then sudo dpkg -i robodoc_4.99.41-1_amd64.deb && robodoc --version; fi
52+
- if [[ $DOCS == [yY]* ]]; then sudo -H pip install ford && ford --version; fi
5453
- if [[ $CHECK_README_PROGS == [yY]* ]]; then gfortran -o f90split f90split.f90 && ./f90split README.md && shopt -s extglob && for f in !(README|CONTRIBUTING|CHANGELOG).md; do mv $f src/tests/jf_test_${f%.md}.f90; done; rm f90split.f90 f90split; fi
5554

5655
script:
@@ -62,4 +61,4 @@ after_success:
6261
- if [[ $CODE_COVERAGE == [yY]* ]]; then bash <(curl -s https://codecov.io/bash) ; fi
6362
- git config --global user.name "TRAVIS-CI-for-$(git --no-pager show -s --format='%cn' $TRAVIS_COMMIT)"
6463
- git config --global user.email "$(git --no-pager show -s --format='%ce' $TRAVIS_COMMIT)"
65-
- ./deploy.sh #handles updating documentation for master branch as well as tags
64+
#broken for now# - ./deploy.sh #handles updating documentation for master branch as well as tags

CMakeLists.txt

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -138,41 +138,46 @@ set_target_properties ( ${LIB_NAME}
138138
Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR} )
139139

140140
#-------------------------------------
141-
# Build the documentation with ROBODoc
141+
# Build the documentation with FORD
142142
#-------------------------------------
143143
set ( SKIP_DOC_GEN FALSE CACHE BOOL
144-
"Disable building the API documentation with ROBODoc" )
144+
"Disable building the API documentation with FORD" )
145145
if ( NOT SKIP_DOC_GEN )
146-
find_program ( ROBODOC robodoc )
147-
if ( ROBODOC ) # Found
148-
set ( ROBODOC_OPTIONS --rc ${CMAKE_SOURCE_DIR}/robodoc.rc
149-
CACHE STRING "Options passed to robodoc to control building the documentation" )
150-
set ( DOC_DIR "${CMAKE_BINARY_DIR}/documentation" )
151-
set ( REQUIRED_ROBODOC_OPTIONS
152-
--src "${CMAKE_SOURCE_DIR}/src" --doc "${DOC_DIR}"
153-
--documenttitle "${CMAKE_PROJECT_NAME}" )
154-
# Dynamically generate the ROBODoc outputs list
155-
message ( STATUS "Dynamically computing ROBODoc output information..." )
156-
execute_process ( COMMAND ${CMAKE_COMMAND} -E remove_directory ${DOC_DIR}
157-
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOC_DIR}
158-
COMMAND "${ROBODOC}" ${REQUIRED_ROBODOC_OPTIONS} ${ROBODOC_OPTIONS} )
159-
file ( GLOB_RECURSE ROBODOC_OUTPUTS
160-
"${DOC_DIR}/*" )
161-
execute_process ( COMMAND ${CMAKE_COMMAND} -E remove_directory ${DOC_DIR} )
162-
message ( STATUS "Done dynamically computing ROBODoc outputs." )
146+
find_program ( FORD ford )
147+
if ( FORD ) # Found
148+
file ( COPY "${CMAKE_SOURCE_DIR}/media" DESTINATION "${CMAKE_BINARY_DIR}/" )
149+
set ( DOC_DIR "${CMAKE_BINARY_DIR}/doc" )
150+
set ( FORD_PROJECT_FILE "${CMAKE_SOURCE_DIR}/json-fortran.md" )
151+
# Dynamically generate the FORD outputs list
152+
message ( STATUS "Dynamically computing FORD output information..." )
153+
if ( NOT (DEFINED FORD_OUTPUTS_CACHED) )
154+
message ( STATUS "Running FORD to dynamically compute documentation outputs, this could take a while..." )
155+
execute_process ( COMMAND ${CMAKE_COMMAND} -E remove_directory ${DOC_DIR}
156+
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOC_DIR}
157+
COMMAND "${FORD}" -d "${CMAKE_SOURCE_DIR}/src" -o "${DOC_DIR}" "${FORD_PROJECT_FILE}" OUTPUT_QUIET )
158+
endif ()
159+
file ( GLOB_RECURSE FORD_OUTPUTS
160+
"${DOC_DIR}/*.html" )
161+
file ( GLOB_RECURSE FORD_CLEAN_OUTPUTS
162+
"${DOC_DIR}/*.*" )
163+
if ( (DEFINED FORD_OUTPUTS) AND ( NOT ( "${FORD_OUTPUTS}" STREQUAL "" ) ) )
164+
set ( FORD_OUTPUTS_CACHED "${FORD_OUTPUTS}"
165+
CACHE INTERNAL "internal variable to attempt to prevent rebuilding FORD docs" FORCE )
166+
endif ()
167+
message ( STATUS "Done dynamically computing FORD outputs." )
163168

164169
foreach ( SRC_FILE ${JF_LIB_SRCS} ${JF_TEST_SRCS} )
165-
list ( APPEND ROBO_DEPENDS "${SRC_FILE}" )
170+
list ( APPEND FORD_DEPENDS "${SRC_FILE}" )
166171
endforeach ( SRC_FILE )
167-
add_custom_command ( OUTPUT ${ROBODOC_OUTPUTS}
168-
COMMAND "${CMAKE_COMMAND}" -E make_directory "${DOC_DIR}" # Ensure DOC_DIR exists at build time
169-
COMMAND "${ROBODOC}" ${REQUIRED_ROBODOC_OPTIONS} ${ROBODOC_OPTIONS}
170-
DEPENDS ${ROBO_DEPENDS}
171-
COMMENT "Building HTML documentation for ${CMAKE_PROJECT_NAME} using ROBODoc" )
172+
add_custom_command ( OUTPUT ${FORD_OUTPUTS_CACHED}
173+
COMMAND "${FORD}" -d "${CMAKE_SOURCE_DIR}/src" -o "${DOC_DIR}" "${FORD_PROJECT_FILE}"
174+
MAIN_DEPENDENCY "${FORD_PROJECT_FILE}"
175+
DEPENDS ${FORD_DEPENDS}
176+
COMMENT "Building HTML documentation for ${CMAKE_PROJECT_NAME} using FORD" )
172177
add_custom_target ( documentation ALL
173-
DEPENDS ${ROBODOC_OUTPUTS} )
178+
DEPENDS ${FORD_OUTPUTS} )
174179
set ( INSTALL_API_DOCUMENTATION TRUE
175-
CACHE BOOL "Install ROBODoc generated documentation?" )
180+
CACHE BOOL "Install FORD generated documentation?" )
176181
if ( INSTALL_API_DOCUMENTATION )
177182
if ( USE_GNU_INSTALL_CONVENTION )
178183
install ( DIRECTORY "${DOC_DIR}/" DESTINATION "${CMAKE_INSTALL_DOCDIR}" )
@@ -182,7 +187,7 @@ if ( NOT SKIP_DOC_GEN )
182187
endif ()
183188
else () # Not found
184189
message ( WARNING
185-
"ROBODoc not found! Please set the CMake cache variable ROBODOC to point to the installed ROBODoc binary, and reconfigure or disable building the documentation. ROBODoc can be installed from: http://www.xs4all.nl/~rfsber/Robo/ If you do not wish to install ROBODoc and build the json-fortran documentation, then please set the CMake cache variable SKIP_DOC_GEN to TRUE." )
190+
"FORD not found! Please set the CMake cache variable FORD to point to the installed FORD executable, and reconfigure or disable building the documentation. FORD can be installed from PYPI with `sudo pip install FORD` or from <https://github.com/cmacmackin/ford> If you do not wish to install FORD and build the json-fortran documentation, then please set the CMake cache variable SKIP_DOC_GEN to TRUE." )
186191
endif ()
187192
endif ()
188193

@@ -209,7 +214,7 @@ if ( ENABLE_TESTS )
209214
set ( DATA_DIR "${CMAKE_BINARY_DIR}/files" )
210215

211216
set_directory_properties ( PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
212-
"${DATA_DIR}/test2.json;${DATA_DIR}/test4.json" )
217+
"${DATA_DIR}/test2.json;${DATA_DIR}/test4.json;${FORD_CLEAN_OUTPUTS}" )
213218

214219
# Validate input
215220
if ( JSONLINT )
@@ -222,7 +227,7 @@ if ( ENABLE_TESTS )
222227
get_filename_component ( TESTNAME "${VALID_JSON}" NAME )
223228
add_test ( NAME validate-${TESTNAME}
224229
WORKING_DIRECTORY "${DATA_DIR}/inputs"
225-
COMMAND ${JSONLINT} "${VALID_JSON}" )
230+
COMMAND ${JSONLINT} "--allow=nonescape-characters" "${VALID_JSON}" )
226231
endforeach ()
227232

228233
foreach ( INVALID ${INVALID_JSON} )
@@ -267,7 +272,7 @@ if ( ENABLE_TESTS )
267272
get_filename_component ( TESTNAME ${JSON_FILE} NAME )
268273
add_test ( NAME validate-output-${TESTNAME}
269274
WORKING_DIRECTORY "${DATA_DIR}"
270-
COMMAND ${JSONLINT} ${TESTNAME} )
275+
COMMAND ${JSONLINT} "--allow=nonescape-characters" ${TESTNAME} )
271276
set_property ( TEST validate-output-${TESTNAME}
272277
APPEND
273278
PROPERTY

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ git rebase upstream/master
9090
- Please adhere to the code indentation and formatting as it currently exists, aligning common elements vertically, etc. Tab characters are not allowed. Indentations should be done with *4* space characters.
9191
- *Do NOT* allow your editor to make a bunch of indentation or white space changes, that will introduce non-substantive changes on lines that you have not actually edited.
9292
- The coding style is modern free-form Fortran, consistent with the Fortran 2008 standard. Note that the two supported compilers (ifort and gfortran) do not currently include the entire Fortran 2008 standard. Therefore, only those language features supported by Gfortran 4.9 and Intel 13.1.0 are currently allowed. This also means that previous versions of these compilers are not supported, and major changes to the code to support earlier compilers (or Fortran 95) will not be accepted. At some point in the future (when compiler support has improved), all Fortran 2008 features will be allowed.
93-
- All subroutines and functions *must* be properly documented. This includes useful inline comments as well as comment blocks using the [ROBODoc](http://rfsber.home.xs4all.nl/Robo/manual.html) syntax.
93+
- All subroutines and functions *must* be properly documented. This includes useful inline comments as well as comment blocks using the [FORD](https://github.com/cmacmackin/ford/wiki/Writing-Documentation) syntax.
9494
- For simplicity, json-fortran currently consists of one module file. It is not envisioned that it will ever need to expand to include multiple files (if it does, there would need to be a very good reason).
9595

9696
[top](#contributing-to-json-fortran)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ brew install --with-unicode-support json-fortran
6868
_Please note_, if you wish to support usage of json-fortran with
6969
multiple Fortran compilers, please follow the CMake installation
7070
instructions below, as the homebrew installation is only intended to
71-
support a single Fortran compiler. Cheers! :beers:
71+
support a single Fortran compiler. Cheers!
7272

7373
[top](#json-fortran)
7474

@@ -287,7 +287,7 @@ The code above produces the file:
287287
Documentation
288288
--------------
289289

290-
The API documentation for the latest release version can be found [here](http://jacobwilliams.github.io/json-fortran). The documentation can also be generated by processing the source files with [RoboDoc](http://rfsber.home.xs4all.nl/Robo/). Note that both the shell script, CMake, and SCons will also generate these files automatically in the documentation folder, assuming you have RoboDoc installed.
290+
The API documentation for the latest release version can be found [here](http://jacobwilliams.github.io/json-fortran). The documentation can also be generated by processing the source files with [FORD](https://github.com/cmacmackin/ford). Note that both the shell script, CMake, and SCons will also generate these files automatically in the documentation folder, assuming you have FORD installed.
291291

292292
[top](#json-fortran)
293293

build.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# profiling flags
2121
# with :
2222
# unit tests enabled
23-
# documentation (if ROBODoc is installed)
23+
# documentation (if FORD is installed)
2424
#
2525
# More recent (right-most) flags will override preceding flags
2626
# flags:
@@ -51,19 +51,19 @@
5151
# fortran unit tests
5252
#
5353
# --skip-documentation [{yes|no}]: Skip (or don't skip) building the json-
54-
# fortran documentation using ROBODoc
54+
# fortran documentation using FORD
5555
#
5656
# REQUIRES
5757
# FoBiS.py : https://github.com/szaghi/FoBiS [version 1.2.5 or later required]
58-
# RoboDoc : http://rfsber.home.xs4all.nl/Robo/ [version 4.99.38 is the one tested]
58+
# FORD : https://github.com/cmacmackin/ford [version 3.0.2 is the one tested]
5959
#
6060
# AUTHOR
6161
# Jacob Williams : 12/27/2014
6262
#
6363

6464
set -e
6565

66-
PROJECTNAME='jsonfortran' # project name for robodoc (example: jsonfortran_2.0.0)
66+
FORDMD='json-fortran.md' # FORD options file for building documentation
6767
DOCDIR='./documentation/' # build directory for documentation
6868
SRCDIR='./src/' # library source directory
6969
TESTDIR='./src/tests/' # unit test source directory
@@ -280,14 +280,14 @@ else
280280
echo "Skip building the unit tests since \$JF_SKIP_TESTS has been set to 'true'."
281281
fi
282282

283-
#build the documentation with RoboDoc (if present):
283+
#build the documentation with ford (if present):
284284
echo ""
285285
if [[ $JF_SKIP_DOCS != [yY]* ]]; then
286-
if hash robodoc 2>/dev/null; then
286+
if hash ford 2>/dev/null; then
287287
echo "Building documentation..."
288-
robodoc --rc ./robodoc.rc --src ${SRCDIR} --doc ${DOCDIR} --documenttitle ${PROJECTNAME}
288+
ford $FORDMD
289289
else
290-
echo "ROBODoc not found! Cannot build documentation. ROBODoc can be installed from: http://www.xs4all.nl/~rfsber/Robo/"
290+
echo "FORD not found! Install using: sudo pip install ford"
291291
fi
292292
else
293293
echo "Skip building documentation since \$JF_SKIP_DOCS has been set to ${JF_SKIP_DOCS}."

json-fortran.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
project: json-fortran
2+
favicon: ./media/json-fortran-32x32.png
3+
project_dir: ./src
4+
macro: USE_UCS4
5+
output_dir: ./doc
6+
media_dir: ./media
7+
project_github: https://github.com/jacobwilliams/json-fortran
8+
summary: JSON-FORTRAN -- A Fortran 2008 JSON API
9+
author: Jacob Williams
10+
github: https://github.com/jacobwilliams
11+
website: http://degenerateconic.com
12+
twitter: https://twitter.com/degenerateconic
13+
predocmark_alt: >
14+
predocmark: <
15+
docmark_alt:
16+
docmark: !
17+
exclude_dir: tests
18+
exclude_dir: introspection
19+
display: public
20+
protected
21+
private
22+
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]
34+
35+
# Brief description
36+
37+
A user-friendly and object-oriented API for reading and writing JSON files, written in
38+
modern Fortran (Fortran 2003+). The source code is a single Fortran module file ([json_module.F90](https://github.com/jacobwilliams/json-fortran/blob/master/src/json_module.F90)).
39+
40+
# License
41+
42+
The json-fortran source code and related files and documentation are distributed under a permissive free software license (BSD-style). See the [LICENSE](https://raw.githubusercontent.com/jacobwilliams/json-fortran/master/LICENSE) file for more details.
43+
44+
# Miscellaneous
45+
46+
* For more information about JSON, see: <http://www.json.org/>

media/json-fortran-32x32.png

4.17 KB
Loading
File renamed without changes.

0 commit comments

Comments
 (0)