-
Notifications
You must be signed in to change notification settings - Fork 361
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
NEST Help Generator #464
Changes from all commits
Commits
Show all changes
79 commits
Select commit
Hold shift + click to select a range
0b7e757
initial commit
steffengraber bd8c620
Better SeeAlso
steffengraber 63060c2
Requires from the ifdef-sections now works
steffengraber 0da9b08
first step to helpindex.html
steffengraber bf6dec7
with helpindex.html
steffengraber 9824c9c
Version 0.1
steffengraber cb89d25
Merge branch 'master' into help-build
tammoippen d366779
Generate help2 with python script
tammoippen a68b58d
ignore pyc files
tammoippen db1ab2e
let python remove the old dir
tammoippen 35a0df3
move help generation into base CMakeLists.txt
tammoippen 0e5f315
Merge pull request #1 from tammoippen/help-build
steffengraber 31b0844
initial commit
steffengraber 63b426f
Better SeeAlso
steffengraber 144c960
Requires from the ifdef-sections now works
steffengraber 5f27f05
first step to helpindex.html
steffengraber 6640ed1
with helpindex.html
steffengraber 0b38e4e
Version 0.1
steffengraber 178694c
some regex enhancements
steffengraber 63b58e6
Merge branch 'master' into help-build
steffengraber 96831fd
Merge branch 'help-build' of https://github.com/steffengraber/nest-si…
steffengraber 1407a28
better regex
steffengraber 47a9f58
bugfix and make it look better of the .hlp files, \nbetter coding
steffengraber a6cedc7
introducing textwrap
steffengraber 4d02b35
minor changes
steffengraber 08dcd6a
replace 3 ' ' with a '/\t' to get a better text formatation
steffengraber 0400572
Better looking .hlp files
steffengraber 4bcd5c7
Merge branch 'master' into help-build
steffengraber b4fe9a4
tricks for the blanks
steffengraber 95d2fa3
minor edit
steffengraber 1752317
Merge branch 'master' into help-build
steffengraber 258de76
Some smaller changes, for a better looking.
steffengraber a8d43d0
Merge branch 'master' into help-build
steffengraber 587a2ef
test
steffengraber b8f436e
Excluded folder /examples/MyModule from search.
steffengraber de29e13
Merge branch 'master' into help-build
steffengraber 32e2e61
deleted CMakeLists.txt.orig
steffengraber 0c84122
Minor edit in README
steffengraber e6f63b1
Rename trenner -> status
steffengraber 2be011f
Changed copyright to 2004
steffengraber cc8bbe9
removed /- /--> def - 1. 1. eq exch pop assert_or_die
steffengraber f79d5a4
PEP8 errors.
steffengraber ec8db58
Changed README and removed artefacts from an failed merge.
steffengraber 40fbdbb
Removed wrong text from line 112
steffengraber 8c5b094
.gitignore
steffengraber 07dcb0a
Update .travis.yml
steffengraber 38c820f
# safelist in .travis.yml
steffengraber f423343
Update .travis.yml
steffengraber 5722930
Update .travis.yml
steffengraber 136f640
Update .travis.yml
steffengraber 37c7114
Update .travis.yml
steffengraber ade016f
Introducing pythons template strings for a cleaner code.
steffengraber 7b66950
Merge branch 'master' into help-build
steffengraber bcfaf76
Merge branch 'help-build' of https://github.com/steffengraber/nest-si…
steffengraber 5b13048
Templates
steffengraber 41f92e4
Deleted /sli/helpinit.sli for testing
steffengraber 8d1c5fb
Merge branch 'master' of https://github.com/steffengraber/nest-simulator
steffengraber 8d91da5
reintroducing lib/sli/helpinit.sli
steffengraber ac63105
commenting out the test in test_round_validate.sli
steffengraber 0e6f72a
moved import re
steffengraber d092d5d
Added unittests/test_round.sli, replacing test_round_validate.sli.
steffengraber 9ad7a97
only txt in .hlp files
steffengraber 1ef468c
try it with old test_round_validate.sli
steffengraber e1fa065
add old test_round_validate.sli
steffengraber e65882d
now with new test_round.sli again
steffengraber 8263da0
Merge remote-tracking branch 'upstream/master' into help-build
steffengraber 03010b9
Merge remote-tracking branch 'upstream/master'
steffengraber db9c891
Merge remote-tracking branch 'upstream/master'
steffengraber f74eba5
Merge branch 'master' into help-build
steffengraber 4911c8d
Create the index files new.
steffengraber 2a49f75
Merged help-build_cleanup
steffengraber 5724e41
delete log print
steffengraber 9b01175
pep8
steffengraber 279e2c5
pep8
steffengraber 90b69f8
added some minor enhancemnts
steffengraber 2e04135
added some minor enhancemnts
steffengraber a3c9e67
Better format for index.hlp
steffengraber 8fb83d9
Pep 8
steffengraber f394b9c
Pep 8 line too long
steffengraber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ pynest/pynestkernel.cpp | |
*.la | ||
.* | ||
*.log | ||
*.pyc | ||
Makefile | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are more artefacts from an unresolved merge conflict. Please remove them and also the line with |
||
build/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# cmake/GenerateHelp.cmake | ||
# | ||
# This file is part of NEST. | ||
# | ||
# Copyright (C) 2004 The NEST Initiative | ||
# | ||
# NEST is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# NEST is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with NEST. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
function(NEST_GENERATE_HELP) | ||
# DIRS for help | ||
# | ||
# base dirs + dirs/sli | ||
|
||
set( __HELPDIRS libnestutil sli librandom lib nestkernel nest ${SLI_MODULES} ) | ||
foreach ( child ${__HELPDIRS} ) | ||
if ( IS_DIRECTORY "${PROJECT_SOURCE_DIR}/${child}" ) | ||
set( HELPDIRS "${HELPDIRS}${PROJECT_SOURCE_DIR}/${child}:" ) | ||
# Automatically include sli directory if it exists | ||
if ( IS_DIRECTORY "${PROJECT_SOURCE_DIR}/${child}/sli" ) | ||
set( HELPDIRS "${HELPDIRS}${PROJECT_SOURCE_DIR}/${child}/sli:" ) | ||
endif () | ||
endif () | ||
endforeach () | ||
|
||
# testsuite dirs | ||
file( GLOB children ${PROJECT_SOURCE_DIR}/testsuite/*/ ) | ||
foreach ( child ${children} ) | ||
if ( IS_DIRECTORY ${child} ) | ||
set( HELPDIRS "${HELPDIRS}${child}:" ) | ||
endif () | ||
if ( IS_DIRECTORY ${child}/pass ) | ||
set( HELPDIRS "${HELPDIRS}${child}/pass:" ) | ||
endif () | ||
if ( IS_DIRECTORY ${child}/fail ) | ||
set( HELPDIRS "${HELPDIRS}${child}/fail:" ) | ||
endif () | ||
endforeach () | ||
|
||
if ( NOT CMAKE_CROSSCOMPILING ) | ||
install( CODE | ||
"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() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# helpers.py | ||
# | ||
# This file is part of NEST. | ||
# | ||
# Copyright (C) 2004 The NEST Initiative | ||
# | ||
# NEST is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# NEST is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# 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 text by separator. | ||
""" | ||
if separator: | ||
return re.split(separator, text) | ||
else: | ||
return [separator, text] | ||
|
||
|
||
def check_ifdef(item, filetext, docstring): | ||
""" | ||
Check the 'ifdef' context | ||
------------------------- | ||
|
||
If there is an 'ifdef' requirement write it to the data. | ||
""" | ||
ifdefstring = r'(\#ifdef((.*?)\n(.*?)\n*))\#endif' | ||
require_reg = re.compile('HAVE\_((.*?)*)\n') | ||
# every doc in an #ifdef | ||
ifdefs = re.findall(ifdefstring, filetext, re.DOTALL) | ||
for ifitem in ifdefs: | ||
for str_ifdef in ifitem: | ||
initems = re.findall(docstring, str_ifdef, re.DOTALL) | ||
for initem in initems: | ||
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')) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are more artefacts from an unresolved merge conflict. Please remove them and also the line with
config.status
.