Skip to content
New issue

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

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

Already on GitHub? # to your account

nifxml 0.9 specification sync #8

Open
wants to merge 27 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
edc0af7
Update nifxml submodule
hexabits Jun 28, 2017
7d7cc38
Prefix/suffix attribute support for nif.xml
hexabits Jun 28, 2017
a38d49f
Update for userver2 attribute
hexabits Jun 28, 2017
318ca60
Update for colons in niobject names
hexabits Jun 28, 2017
98356ae
Add mult and div operators
hexabits Jun 28, 2017
34e8324
Attempt cast for duplicate names with differing types
hexabits Jul 26, 2017
de0f5e0
Support abstract members
hexabits Oct 6, 2017
f98dc21
Nested compounds update
hexabits Oct 6, 2017
1d2f395
nifxml 0.9 niflibtype removal
hexabits Nov 21, 2017
03da4de
Remove duplicates from cpp file includes
hexabits Nov 21, 2017
735de17
Correct handling of array_output_count for nested compounds
hexabits Nov 21, 2017
0a37f76
Python 3 support
hexabits Dec 17, 2017
5eb2321
Update nifxml and kfmxml
hexabits Dec 17, 2017
1175613
nifxml 0.9 member accessor support for arg
hexabits Dec 17, 2017
07dc05f
ICO file update for new logo
hexabits Dec 18, 2017
0671a2d
Move CFile to gen_niflib, rename niflibtype
hexabits Dec 19, 2017
fff14dc
Assure valid float default strings
hexabits Dec 19, 2017
92df236
Move repetitious strings to variables, specialize code() for namespac…
hexabits Dec 19, 2017
ebcee67
Pylint first pass
hexabits Dec 20, 2017
af99c64
Move niflib code out of nifxml
hexabits Dec 21, 2017
897068f
Fix bug with "Can be used as array size"
hexabits Dec 21, 2017
cf3aca1
Fix links for BSSkin::* niobjects
hexabits Dec 21, 2017
8703ec1
Complete nifxml_doc rewrite, new license
hexabits Jan 6, 2018
dc96f68
Update gen_niflib for nifxml.py
hexabits Jan 7, 2018
b8ef1e1
Rename nifxml_doc
hexabits Jan 7, 2018
1d9b197
Remove docsys references
hexabits Jan 7, 2018
6bb4cc7
Reorganization, cleanup
hexabits Jan 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Generated html
*.html

# VS Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
17 changes: 0 additions & 17 deletions .project

This file was deleted.

674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
__all__ = ["nifxml"]

from .nifxml import parse_xml
from .nifxml import Member, Version, Basic, Compound, Block, Enum, Flag
from .nifxml import TYPES_VERSION, TYPES_BASIC, TYPES_BLOCK, TYPES_COMPOUND, TYPES_ENUM, TYPES_FLAG, TYPES_NATIVE
from .nifxml import NAMES_VERSION, NAMES_BASIC, NAMES_BLOCK, NAMES_COMPOUND, NAMES_ENUM, NAMES_FLAG
from .nifxml import class_name, define_name, member_name, version2number, scanBrackets
Empty file added doc/__init__.py
Empty file.
Binary file modified doc/favicon.ico
Binary file not shown.
25 changes: 15 additions & 10 deletions doc/docsys.css → doc/nifdoc.css
Original file line number Diff line number Diff line change
@@ -2,26 +2,31 @@ hr { border: 1px; color: black; background: black; height: 1px; }
body { font-family: Verdana, Arial, Helvetica, sans-serif; }
p, td, th, div, pre, li { color: black; font-size: 10pt; }
td { vertical-align: text-top; }
a { color: #006699; text-decoration: none;}
a:link { color: #006699; text-decoration: none;}
a:visited { color: #006699; text-decoration: none;}
a { color: #2087bb; text-decoration: none;}
a:link { color: #2087bb; text-decoration: none;}
a:visited { color: #2087bb; text-decoration: none;}
a:active { text-decoration: none;}
a:hover { color: #DD6900; text-decoration: underline;}

table { width: 100%; }
th { font-weight: bold; color: black; background: #D3DCE3}
h1 { text-align: center; color: black; background: #FF6600; }
h2 { text-align: center; color: black; background: #FFCC33; }
h3 { text-align: left; color: black; background: #FFCC66; }
a:link { text-decoration: none; color: #006699; background: transparent; }
a:visited { text-decoration: none; color: #006699; background: transparent; }
a:link { text-decoration: none; color: #2087bb; background: transparent; }
a:visited { text-decoration: none; color: #2087bb; background: transparent; }
a:hover { text-decoration: underline; color: #DD6900; background: transparent; }
a:link.nav { color: #000000; background: transparent; }
a:visited.nav { color: #000000; background: transparent; }
a:hover.nav { color: #FF0000; background: transparent; }
.nav { color: #000000; background: transparent; }
tr.reg0 { background: #CCCCCC; color: black; }
tr.reg1 { background: #DDDDDD; color: black; }
tr.inact0 { background: #CCAAAA; color: black; }
tr.inact1 { background: #DDBBBB; color: black; }
tr.extrnl { background: #AADDAA; color: black; }
tr { background: #DDDDDD; color: black; }
tr.odd { background: #DDDDDD; color: black; }
tr.even { background: #EEEEEE; color: black; }

td.aname { white-space: nowrap; }
td.atype { white-space: nowrap; }
td.aarg { font-size: small; font-family: 'Courier New', Courier, monospace; }
td.aarr1 { font-size: small; font-family: 'Courier New', Courier, monospace; }
td.aarr2 { font-size: small; font-family: 'Courier New', Courier, monospace; }
td.acond { font-size: small; font-family: 'Courier New', Courier, monospace; }
207 changes: 207 additions & 0 deletions doc/nifdoc_tmpl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
#!/usr/bin/python
"""
This file is part of nifxml <https://github.com/niftools/nifxml>
Copyright (c) 2017 NifTools

This program 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, version 3.

This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
"""
from __future__ import unicode_literals

UL_ITEM = '<ul>\n{0}</ul>\n'
LI_LINK = '\t<li><a href="{0}.html">{1}</a></li>\n'
LI_LINK_DESC = '<li><a href="{0}.html"><b>{1}</b></a> | {2}</li>\n'
TYPE_LINK = '<a href="{0}.html"><b>{1}</b></a>'
TMPL_LINK = '&lt;<a href="{0}.html">{1}</a>&gt;'

MAIN_BEG = """<!doctype html>
<html lang="en">
<head>
\t<title>NIF File Format Documentation - {title}</title>
\t<link rel="stylesheet" href="nifdoc.css" type="text/css" />
\t<link rel="icon" href="favicon.ico" type="image/x-icon" />
</head>
<body>"""
MAIN_END = """
\t<p align="center"><a href="index.html">NIF Objects</a> | <a href="compound_list.html">Compound Types</a>
\t| <a href="enum_list.html">Enum Types</a> | <a href="basic_list.html">Basic Types</a> | <a href="version_list.html">File Versions</a></p>
\t{contents}
</body>
</html>"""

# Main HTML template with and without H1 heading
MAIN_H1 = MAIN_BEG + '<center><h1>NIF File Format Documentation</h1></center>' + MAIN_END
MAIN_NO_H1 = MAIN_BEG + MAIN_END

# Attribute row with metadata
ATTR = """
<tr class="{row}">
\t<td class="aname">{attr_name}</td>
\t<td class="atype">{attr_type}</td>
\t<td class="aarg">{attr_arg}</td>
\t<td class="aarr1">{attr_arr1}</td>
\t<td class="aarr2">{attr_arr2}</td>
\t<td class="acond">{attr_cond}</td>
\t<td class="adesc">{attr_desc}</td>
\t<td class="afrom">{attr_from}</td>
\t<td class="ato">{attr_to}</td>
</tr>
"""

# Attribute row without metadata
ATTR_NO_META = """
<tr class="{row}">
\t<td class="aname">{attr_name}</td>
\t<td class="atype">{attr_type}</td>
\t<td class="adesc">{attr_desc}</td>
</tr>
"""

# List for Found In
FOUND_IN = """
<h3>Found In</h3>
<ul>
{member_of}
</ul>
"""

# List for Parent Of
PARENT_OF = """
<h3>Parent Of</h3>
<ul>
{parent_of}
</ul>"""

# Basic layout
BASIC = """
<center><h2>{name}</h2></center>
{description}

<h3>Can Be Used As Array Size</h3>
<p>{count}</p>
""" + FOUND_IN

# Block with metadata columns
BLOCK = """
<center><h2>{name}</h2></center>
{description}
<h3>Attributes</h3>
<table>
\t<tr>
\t\t<th>Name</th>
\t\t<th>Type</th>
\t\t<th>Arg</th>
\t\t<th>Arr1</th>
\t\t<th>Arr2</th>
\t\t<th>Cond</th>
\t\t<th>Description</th>
\t\t<th>From</th><th>To</th>
\t</tr>
\t{attributes}
</table>
"""

# Block without metadata columns
BLOCK_NM = """
<center><h2>{name}</h2></center>
{description}
<h3>Attributes</h3>
<table>
\t<tr>
\t\t<th>Name</th>
\t\t<th>Type</th>
\t\t<th>Description</th>
\t</tr>
\t{attributes}
</table>
"""

# Compound and NiObject with and without metadata columns
COMPOUND = BLOCK + FOUND_IN
NIOBJECT = BLOCK + PARENT_OF
COMPOUND_NO_META = BLOCK_NM + FOUND_IN
NIOBJECT_NO_META = BLOCK_NM + PARENT_OF

# Object tree for index.html
HIERARCHY = """
<ul>{object_tree}</ul>"""

# Object list for *_list.html
LIST = """
<table>
\t<tr>
\t\t<th>{list_header}</th>
\t\t<th>Description</th>
\t</tr>
{list}
</table>"""

# Navbar
NAV = """<p align="center"><a href="index.html">Hierarchy</a> | <a href="niobject_list.html">List</a></p>
<center><h2>{title}</h2></center>
"""

# Nav plus contents
NAV_LIST = NAV + LIST
NAV_HIER = NAV + HIERARCHY

# Enum layout
ENUM = """
<h2>{name}</h2>
{description}

<h3>Choices</h3>
<table>
\t<tr class="{row}">
\t\t<th>Number</th>
\t\t<th>Name</th>
\t\t<th>Description</th>
\t</tr>
\t{choices}
</table>

<h3>Storage Type</h3>
<a href ="{storage}.html">{storage}</a>
""" + FOUND_IN

ENUM_ROW = """
<tr class="{row}">
\t<td>{enum_number}</td>
\t<td><b>{enum_name}</b></td>
\t<td>{enum_desc}</td>
</tr>
"""

INHERIT_ROW = """
<tr>
\t<th align="left" style="text-align:left;" colspan="9">From <a href ="{cinherit}.html">{inherit}</a></th>
</tr>
"""

INHERIT_NO_META = """
<tr>
\t<th align="left" style="text-align:left;" colspan="3">From <a href ="{cinherit}.html">{inherit}</a></th>
</tr>
"""

LIST_ROW = """
<tr class="{row}">
\t<td><b><a href="{list_cname}.html">{list_name}</a></b></td>
\t<td>{list_desc}</td>
</tr>"""

VERSION_ROW = """
<tr class="{row}">
\t<td><b>{list_name}</a></b></td>
\t<td>{list_desc}</td>
</tr>
"""
Loading