Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEST Help Generator #464

Merged
merged 79 commits into from Nov 28, 2016
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
0b7e757
initial commit
steffengraber May 11, 2016
bd8c620
Better SeeAlso
steffengraber May 12, 2016
63060c2
Requires from the ifdef-sections now works
steffengraber May 12, 2016
0da9b08
first step to helpindex.html
steffengraber May 12, 2016
bf6dec7
with helpindex.html
steffengraber May 12, 2016
9824c9c
Version 0.1
steffengraber May 13, 2016
cb89d25
Merge branch 'master' into help-build
tammoippen May 19, 2016
d366779
Generate help2 with python script
tammoippen May 19, 2016
a68b58d
ignore pyc files
tammoippen May 19, 2016
db1ab2e
let python remove the old dir
tammoippen May 19, 2016
35a0df3
move help generation into base CMakeLists.txt
tammoippen May 20, 2016
0e5f315
Merge pull request #1 from tammoippen/help-build
steffengraber May 30, 2016
31b0844
initial commit
steffengraber May 11, 2016
63b426f
Better SeeAlso
steffengraber May 12, 2016
144c960
Requires from the ifdef-sections now works
steffengraber May 12, 2016
5f27f05
first step to helpindex.html
steffengraber May 12, 2016
6640ed1
with helpindex.html
steffengraber May 12, 2016
0b38e4e
Version 0.1
steffengraber May 13, 2016
178694c
some regex enhancements
steffengraber Jun 2, 2016
63b58e6
Merge branch 'master' into help-build
steffengraber Jun 2, 2016
96831fd
Merge branch 'help-build' of https://github.com/steffengraber/nest-si…
steffengraber Jun 2, 2016
1407a28
better regex
steffengraber Jun 3, 2016
47a9f58
bugfix and make it look better of the .hlp files, \nbetter coding
steffengraber Jun 23, 2016
a6cedc7
introducing textwrap
steffengraber Jun 28, 2016
4d02b35
minor changes
steffengraber Jun 28, 2016
08dcd6a
replace 3 ' ' with a '/\t' to get a better text formatation
steffengraber Jun 28, 2016
0400572
Better looking .hlp files
steffengraber Jun 29, 2016
4bcd5c7
Merge branch 'master' into help-build
steffengraber Jun 30, 2016
b4fe9a4
tricks for the blanks
steffengraber Jun 30, 2016
95d2fa3
minor edit
steffengraber Jul 13, 2016
1752317
Merge branch 'master' into help-build
steffengraber Jul 13, 2016
258de76
Some smaller changes, for a better looking.
steffengraber Aug 16, 2016
a8d43d0
Merge branch 'master' into help-build
steffengraber Aug 17, 2016
587a2ef
test
steffengraber Aug 17, 2016
b8f436e
Excluded folder /examples/MyModule from search.
steffengraber Aug 18, 2016
de29e13
Merge branch 'master' into help-build
steffengraber Aug 18, 2016
32e2e61
deleted CMakeLists.txt.orig
steffengraber Aug 18, 2016
0c84122
Minor edit in README
steffengraber Aug 18, 2016
e6f63b1
Rename trenner -> status
steffengraber Aug 18, 2016
2be011f
Changed copyright to 2004
steffengraber Aug 18, 2016
cc8bbe9
removed /- /--> def - 1. 1. eq exch pop assert_or_die
steffengraber Aug 18, 2016
f79d5a4
PEP8 errors.
steffengraber Aug 18, 2016
ec8db58
Changed README and removed artefacts from an failed merge.
steffengraber Aug 25, 2016
40fbdbb
Removed wrong text from line 112
steffengraber Aug 25, 2016
8c5b094
.gitignore
steffengraber Aug 30, 2016
07dcb0a
Update .travis.yml
steffengraber Sep 5, 2016
38c820f
# safelist in .travis.yml
steffengraber Sep 6, 2016
f423343
Update .travis.yml
steffengraber Sep 6, 2016
5722930
Update .travis.yml
steffengraber Sep 6, 2016
136f640
Update .travis.yml
steffengraber Sep 6, 2016
37c7114
Update .travis.yml
steffengraber Sep 6, 2016
ade016f
Introducing pythons template strings for a cleaner code.
steffengraber Sep 6, 2016
7b66950
Merge branch 'master' into help-build
steffengraber Sep 6, 2016
bcfaf76
Merge branch 'help-build' of https://github.com/steffengraber/nest-si…
steffengraber Sep 6, 2016
5b13048
Templates
steffengraber Sep 6, 2016
41f92e4
Deleted /sli/helpinit.sli for testing
steffengraber Sep 6, 2016
8d1c5fb
Merge branch 'master' of https://github.com/steffengraber/nest-simulator
steffengraber Sep 6, 2016
8d91da5
reintroducing lib/sli/helpinit.sli
steffengraber Sep 6, 2016
ac63105
commenting out the test in test_round_validate.sli
steffengraber Sep 6, 2016
0e6f72a
moved import re
steffengraber Sep 13, 2016
d092d5d
Added unittests/test_round.sli, replacing test_round_validate.sli.
steffengraber Oct 6, 2016
9ad7a97
only txt in .hlp files
steffengraber Oct 7, 2016
1ef468c
try it with old test_round_validate.sli
steffengraber Oct 7, 2016
e1fa065
add old test_round_validate.sli
steffengraber Oct 7, 2016
e65882d
now with new test_round.sli again
steffengraber Oct 7, 2016
8263da0
Merge remote-tracking branch 'upstream/master' into help-build
steffengraber Nov 2, 2016
03010b9
Merge remote-tracking branch 'upstream/master'
steffengraber Nov 17, 2016
db9c891
Merge remote-tracking branch 'upstream/master'
steffengraber Nov 21, 2016
f74eba5
Merge branch 'master' into help-build
steffengraber Nov 21, 2016
4911c8d
Create the index files new.
steffengraber Nov 23, 2016
2a49f75
Merged help-build_cleanup
steffengraber Nov 23, 2016
5724e41
delete log print
steffengraber Nov 23, 2016
9b01175
pep8
steffengraber Nov 23, 2016
279e2c5
pep8
steffengraber Nov 23, 2016
90b69f8
added some minor enhancemnts
steffengraber Nov 25, 2016
2e04135
added some minor enhancemnts
steffengraber Nov 25, 2016
a3c9e67
Better format for index.hlp
steffengraber Nov 28, 2016
8fb83d9
Pep 8
steffengraber Nov 28, 2016
f394b9c
Pep 8 line too long
steffengraber Nov 28, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -16,7 +16,6 @@ build/
/juqueen/
/extras/nest-config
/extras/create_release.sh
/extras/userdoc/cmds/
/libnestutil/config.h
/librandom/randomtest
/libtool
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -173,6 +173,7 @@ nest_check_have_stl_vector_capacity_doubling()
nest_check_have_xlc_ice_on_using()
nest_check_have_std_nan()
nest_check_have_std_isnan()
nest_generate_help()

################################################################################
################## Enable Testing Targets ##################
Expand Down
28 changes: 5 additions & 23 deletions cmake/GenerateHelp.cmake
Expand Up @@ -48,29 +48,11 @@ function(NEST_GENERATE_HELP)
endforeach ()

if ( NOT CMAKE_CROSSCOMPILING )
# install help (depends on sli and lib/sli/* installed)
install( CODE
"execute_process(
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_INSTALL_FULL_DOCDIR}/help/sli
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_INSTALL_FULL_DOCDIR}/help/cc
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_INSTALL_FULL_DOCDIR}/help/helpindex.html
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_INSTALL_FULL_DOCDIR}/help/helpindex.hlp

COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_INSTALL_FULL_DOCDIR}/help
COMMAND ${CMAKE_COMMAND}
-DDOC_DIR='${CMAKE_INSTALL_FULL_DOCDIR}'
-DDATA_DIR='${CMAKE_INSTALL_FULL_DATADIR}'
-DHELPDIRS='${HELPDIRS}'
-DINSTALL_DIR='${CMAKE_INSTALL_PREFIX}'
-P ${PROJECT_SOURCE_DIR}/cmake/generate_help.cmake
WORKING_DIRECTORY \"${PROJECT_BINARY_DIR}\"
)"
)
install( CODE
"execute_process(
COMMAND ${PYTHON} parse_help.py \"${CMAKE_INSTALL_FULL_DOCDIR}/help2\"
WORKING_DIRECTORY \"${PROJECT_SOURCE_DIR}/extras/userdoc/generator\"
)"
)
"execute_process(
COMMAND python -B parse_help.py \"${PROJECT_SOURCE_DIR}\" \"${PROJECT_BINARY_DIR}\" \"${CMAKE_INSTALL_FULL_DOCDIR}/help\"
WORKING_DIRECTORY \"${PROJECT_SOURCE_DIR}/extras/help_generator\"
)"
)
endif ()
endfunction()
51 changes: 0 additions & 51 deletions cmake/generate_help.cmake

This file was deleted.

14 changes: 5 additions & 9 deletions examples/MyModule/CMakeLists.txt
Expand Up @@ -268,18 +268,14 @@ install( FILES ${MODULE_HEADER} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
install( DIRECTORY sli DESTINATION ${CMAKE_INSTALL_DATADIR} )

# Install help.
set( HELPDIRS "${PROJECT_SOURCE_DIR}:${PROJECT_SOURCE_DIR}/sli" )
install( CODE
"execute_process(COMMAND ${CMAKE_COMMAND}
-DDOC_DIR='${CMAKE_INSTALL_FULL_DOCDIR}'
-DDATA_DIR='${CMAKE_INSTALL_FULL_DATADIR}'
-DHELPDIRS='${HELPDIRS}'
-DINSTALL_DIR='${CMAKE_INSTALL_PREFIX}'
-P ${CMAKE_INSTALL_FULL_DOCDIR}/generate_help.cmake
WORKING_DIRECTORY \"${PROJECT_BINARY_DIR}\"
)"
"execute_process(
COMMAND python -B parse_help.py ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR} \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DOCDIR}/help\"
WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}/${NEST_DATADIR}/help_generator\"
)"
)


message( "" )
message( "-------------------------------------------------------" )
message( "${MODULE_NAME} Configuration Summary" )
Expand Down
4 changes: 4 additions & 0 deletions extras/CMakeLists.txt
Expand Up @@ -28,6 +28,10 @@ install( DIRECTORY bibliography logos
DESTINATION ${CMAKE_INSTALL_DOCDIR}
)

install( DIRECTORY help_generator
DESTINATION ${CMAKE_INSTALL_DATADIR}
)

install( FILES EditorSupport/emacs/postscript-sli.el EditorSupport/emacs/psvn.el ${CMAKE_CURRENT_BINARY_DIR}/EditorSupport/emacs/sli.el
DESTINATION ${CMAKE_INSTALL_DATADIR}/extras/EditorSupport/emacs
)
Expand Down
2 changes: 1 addition & 1 deletion extras/EditorSupport/vim/syntax/sli.vim
Expand Up @@ -16,7 +16,7 @@ setlocal cindent
syntax keyword sliTodo TODO XXX FIXME NOTE
hi def link sliTodo Todo

syn keyword sliKeyword abort abs abs_d abs_i acos add addpath addtotrie allocations and append AppendTo Apply apropos arange area2 area array arrayload ArrayQ ArrayShape arraystore asin assert available backtrace_off backtrace_on begin bind break breakup callback call capacity case cd ceil cerr ChangeSubnet cin clear cleardict cleardictstack clic clock cloc clonedict close closeinput CompareFiles CompileMath Connect connruledict continue copy CopyFile CopyModel cos count countdictstack counttomark cout Create CreateRDV CreateRNG cst ctermid currentdict currentname CurrentSubnet cv1d convert 2-dimensional coordinates to 1-dim index cv2d cva cva_d cva_t cvd cvdict cvd_s cv_dv cvgidcollection cvi cvi_s cv_iv cvlit cvn cvo cvs cvs_f cvt_a cvx cycles CyclicValue DataConnect_a DataConnect DataConnect_i_D_s debug debugoff debugon debug.sli def DeleteFile dexp dict DictQ dictstack Dimensions Directory dirname div Dot1D Dot DoubleQ drand Drop dup2 dup edit elementstates empty end endl endusing environment eof eq_dv eq_iv eq erase Erfc Erf errordict eval EvaluateLiteralInfixes E exch exec ExecFunction ExecMath execstack executive exit exithook exp Export FileNames file FindRoot FiniteQ First FixedPoint Flatten floor flush FoldList Fold forall forallindexed for fork FractionalPart frexp Function gabor_ Gammainc gauss2d_ GaussDiskConv geq GetConnections getc GetDefaults get_d getenv GetGlobalChildren GetGlobalLeaves GetGlobalNodesInfo GetGlobalNodes GetGlobalRNG getinterval getline GetLocalChildren GetLocalLeaves GetLocalNodes GetMax GetMin GetNetwork GetOption GetOptions getPGRP getPID getPPID get gets GetStatus_dict GetStatus GetStatus_v GetSynapseStatus GetVpRNG GNUaddhistory GNUreadline good grep gt handleerror HasDifferentMemberQ helpdesk helpindex help iclear ieof ifail ifstream ignore igood in_avail index info info_ds initialize_module Inline insertelement insert inspect Install IntegerPart IntegerQ inv irand iround isatty is_mpi is_threaded is_threaded_with_openmp join joinpath JoinTo kernel keys kill known LambertW0 LambertWm1 LambertW Last LayoutArray LayoutNetwork ldexp length_a length length_d length_lp length_p length_s leq license LiteralQ ln load LocateFileNames log lookup loop ls lt MakeDirectory makehelp Map MapAt MapIndexed MapThread mark MathematicaToSliIndex mathexecutive MatrixQ Max max Mean MemberQ MemoryInfo memory_thisjob_bg memory_thisjob_darwin memory_thisjob MergeDictionary MergeLists message Min min mkfifo mod modeldict modf Most MoveDirectory MoveFile ms2hms mul namespace neg_d neg_i neg neq Nest nest_indirect NestList nest_serial Node noop not npop NumberQ NumProcesses oclear oeof ofsopen ofstream ogood oldgetline ones operandstack Options OptionsDictionary or osstream ostrstream OuterProduct over page pageoutput parsestdin Partition Part path pclockspersec pclocks pcvs pgetrusage pick pipe Pi Plus pop pow ppage pprint prepend print_error PrintNetwork print ProcessorName proxynode pstack ptimes put_d putinterval put pwd quit raiseagain raiseerror RandomArray Random RandomSubset Range Rank rdevdict ReadDouble ReadInt readline ReadList ReadModes readPGM Read ReadWord realtime references regcomp regexdict regexec regex_find regex_find_r regex_find_rf regex_find_s regex_find_sf regex_replace RemoveDirectory removeguard repeatany repeat ReplaceOccurrences ReplacePart replace reserve ResetKernel ResetNetwork ResetOptions reset RestoreDictionary restoreestack RestoreOptions restoreostack restore Rest resume ResumeSimulation reverse rngdict rolld roll rollu rot round run SaveDictionary SaveOptions save ScanThread searchfile searchif searchifstream search seed Select SetAcceptableLatency SetDefaults Set SetDirectory SetFakeNumProcesses setguard setNONBLOCK SetNumRecProcesses SetOptions setpath setprecision SetStatus_dict SetStatus SetStatus_v SetSynapseStatus setverbosity SFWdumpparameters ShowDefaults ShowOptions ShowStatus shpawn shrink signaldict Sign Simulate sin size sleep_i sleep SLIFunctionWrapper SliToMathematicaIndex Sort spawn spikes Split spoon sqr sqrt stack StandardDeviation start statusdict stopped stop StringQ str subnet SubsetQ sub switchdefault switch symbol symbol_s synapsedict SyncProcesses sysexec system systemtime Table Take taskset taskset_thisjob TensorRank tic TimeCommunicationAlltoall TimeCommunicationAlltoall TimeCommunicationAlltoallv TimeCommunicationAlltoallv TimeCommunicationOffgrid TimeCommunication TimeCommunication TimeCommunicationv time Times tmpnam toc token_is token token_s ToLowercase ToMathematicaExpression topinfo_d Total ToUppercase Transpose trie trieinfo trim trunc typebind typeinfo type typestack undef unit_conversion UnitStep usertime using validate values Variance variant verbosity volume_transmitter waitPID wait welcome which who whos writePGM xifstream xor zeros
syn keyword sliKeyword abort abs abs_d abs_i acos add addpath addtotrie allocations and append AppendTo Apply apropos arange area2 area array arrayload ArrayQ ArrayShape arraystore asin assert available backtrace_off backtrace_on begin bind break breakup callback call capacity case cd ceil cerr ChangeSubnet cin clear cleardict cleardictstack clic clock cloc clonedict close closeinput CompareFiles CompileMath Connect connruledict continue copy CopyFile CopyModel cos count countdictstack counttomark cout Create CreateRDV CreateRNG cst ctermid currentdict currentname CurrentSubnet cv1d convert 2-dimensional coordinates to 1-dim index cv2d cva cva_d cva_t cvd cvdict cvd_s cv_dv cvgidcollection cvi cvi_s cv_iv cvlit cvn cvo cvs cvs_f cvt_a cvx cycles CyclicValue DataConnect_a DataConnect DataConnect_i_D_s debug debugoff debugon debug.sli def DeleteFile dexp dict DictQ dictstack Dimensions Directory dirname div Dot1D Dot DoubleQ drand Drop dup2 dup edit elementstates empty end endl endusing environment eof eq_dv eq_iv eq erase Erfc Erf errordict eval EvaluateLiteralInfixes E exch exec ExecFunction ExecMath execstack executive exit exithook exp Export FileNames file FindRoot FiniteQ First FixedPoint Flatten floor flush FoldList Fold forall forallindexed for fork FractionalPart frexp Function gabor_ Gammainc gauss2d_ GaussDiskConv geq GetConnections getc GetDefaults get_d getenv GetGlobalChildren GetGlobalLeaves GetGlobalNodesInfo GetGlobalNodes GetGlobalRNG getinterval getline GetLocalChildren GetLocalLeaves GetLocalNodes GetMax GetMin GetNetwork GetOption GetOptions getPGRP getPID getPPID get gets GetStatus_dict GetStatus GetStatus_v GetSynapseStatus GetVpRNG GNUaddhistory GNUreadline good grep gt handleerror HasDifferentMemberQ helpdesk helpindex help iclear ieof ifail ifstream ignore igood in_avail index info info_ds initialize_module Inline insertelement insert inspect Install IntegerPart IntegerQ inv irand iround isatty is_mpi is_threaded is_threaded_with_openmp join joinpath JoinTo kernel keys kill known LambertW0 LambertWm1 LambertW Last LayoutArray LayoutNetwork ldexp length_a length length_d length_lp length_p length_s leq license LiteralQ ln load LocateFileNames log lookup loop ls lt MakeDirectory Map MapAt MapIndexed MapThread mark MathematicaToSliIndex mathexecutive MatrixQ Max max Mean MemberQ MemoryInfo memory_thisjob_bg memory_thisjob_darwin memory_thisjob MergeDictionary MergeLists message Min min mkfifo mod modeldict modf Most MoveDirectory MoveFile ms2hms mul namespace neg_d neg_i neg neq Nest nest_indirect NestList nest_serial Node noop not npop NumberQ NumProcesses oclear oeof ofsopen ofstream ogood oldgetline ones operandstack Options OptionsDictionary or osstream ostrstream OuterProduct over page pageoutput parsestdin Partition Part path pclockspersec pclocks pcvs pgetrusage pick pipe Pi Plus pop pow ppage pprint prepend print_error PrintNetwork print ProcessorName proxynode pstack ptimes put_d putinterval put pwd quit raiseagain raiseerror RandomArray Random RandomSubset Range Rank rdevdict ReadDouble ReadInt readline ReadList ReadModes readPGM Read ReadWord realtime references regcomp regexdict regexec regex_find regex_find_r regex_find_rf regex_find_s regex_find_sf regex_replace RemoveDirectory removeguard repeatany repeat ReplaceOccurrences ReplacePart replace reserve ResetKernel ResetNetwork ResetOptions reset RestoreDictionary restoreestack RestoreOptions restoreostack restore Rest resume ResumeSimulation reverse rngdict rolld roll rollu rot round run SaveDictionary SaveOptions save ScanThread searchfile searchif searchifstream search seed Select SetAcceptableLatency SetDefaults Set SetDirectory SetFakeNumProcesses setguard setNONBLOCK SetNumRecProcesses SetOptions setpath setprecision SetStatus_dict SetStatus SetStatus_v SetSynapseStatus setverbosity SFWdumpparameters ShowDefaults ShowOptions ShowStatus shpawn shrink signaldict Sign Simulate sin size sleep_i sleep SLIFunctionWrapper SliToMathematicaIndex Sort spawn spikes Split spoon sqr sqrt stack StandardDeviation start statusdict stopped stop StringQ str subnet SubsetQ sub switchdefault switch symbol symbol_s synapsedict SyncProcesses sysexec system systemtime Table Take taskset taskset_thisjob TensorRank tic TimeCommunicationAlltoall TimeCommunicationAlltoall TimeCommunicationAlltoallv TimeCommunicationAlltoallv TimeCommunicationOffgrid TimeCommunication TimeCommunication TimeCommunicationv time Times tmpnam toc token_is token token_s ToLowercase ToMathematicaExpression topinfo_d Total ToUppercase Transpose trie trieinfo trim trunc typebind typeinfo type typestack undef unit_conversion UnitStep usertime using validate values Variance variant verbosity volume_transmitter waitPID wait welcome which who whos writePGM xifstream xor zeros
hi def link sliKeyword Keyword

syn keyword sliConstant M_INFO M_ERROR M_DEBUG M_WARNING M_STATUS M_FATAL
Expand Down
4 changes: 4 additions & 0 deletions extras/help_generator/README.md
@@ -0,0 +1,4 @@
# README for the NEST help generator

The parser goes through all .sli and .cc files to find documentation
and converts it into .html and .hlp files.
Expand Up @@ -20,25 +20,29 @@
# along with NEST. If not, see <http://www.gnu.org/licenses/>.

import re
import os
import errno


def cut_it(separator, text):
"""
Cut it.
Cut it
------

cut text by separator
Cut text by separator.
"""
if separator:
return re.split(separator, text)
else:
return text
return [separator, text]


def check_ifdef(item, filetext, docstring):
"""
Check the ifdef context.
Check the 'ifdef' context
-------------------------

If there is an ifdef requirement write it to the data.
If there is an 'ifdef' requirement write it to the data.
"""
ifdefstring = r'(\#ifdef((.*?)\n(.*?)\n*))\#endif'
require_reg = re.compile('HAVE\_((.*?)*)\n')
Expand All @@ -51,3 +55,26 @@ def check_ifdef(item, filetext, docstring):
if item == initem:
features = require_reg.search(str_ifdef)
return features.group()


def makedirs(path):
"""
Forgiving version of os.makedirs, emulating the behavior of the
shell command 'mkdir -p'. The function tries to create the
directory at the given path including all subdirectories and
returns silently if the directory already exists.
"""
try:
os.makedirs(path)
except OSError as exc:
if exc.errno != errno.EEXIST or os.path.isdir(path):
raise


def create_helpdirs(path):
"""
Create the directories for the help files.
"""

makedirs(os.path.join(path, 'sli'))
makedirs(os.path.join(path, 'cc'))