Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
djungelorm committed Sep 12, 2018
2 parents 68157db + 830e890 commit 0b7253b
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 4 deletions.
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.PHONY: dist install test clean

dist:
python setup.py sdist

install:
pip install -r requirements.txt
python setup.py install

test:
rm -rf out
pip install pep8
#pep8 src/redjack/sphinx/lua.py
sphinx-build -E -n -W test test-output

clean:
rm -rf build dist test-output *.egg-info
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sphinx
8 changes: 4 additions & 4 deletions src/redjack/sphinx/lua.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def generate(self, docnames=None):
ignores = self.domain.env.config['modindex_common_prefix']
ignores = sorted(ignores, key=len, reverse=True)
# list of all modules, sorted by module name
modules = sorted(self.domain.data['modules'].iteritems(),
modules = sorted(self.domain.data['modules'].items(),
key=lambda x: x[0].lower())
# sort out collapsable modules
prev_modname = ''
Expand Down Expand Up @@ -551,7 +551,7 @@ def generate(self, docnames=None):
collapse = len(modules) - num_toplevels < num_toplevels

# sort by first letter
content = sorted(content.iteritems())
content = sorted(content.items())

return content, collapse

Expand Down Expand Up @@ -707,9 +707,9 @@ def resolve_xref(self, env, fromdocname, builder,
contnode, name)

def get_objects(self):
for modname, info in self.data['modules'].iteritems():
for modname, info in self.data['modules'].items():
yield (modname, modname, 'module', info[0], 'module-' + modname, 0)
for refname, (docname, type) in self.data['objects'].iteritems():
for refname, (docname, type) in self.data['objects'].items():
yield (refname, refname, type, docname, refname, 1)


Expand Down
13 changes: 13 additions & 0 deletions test/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
project = 'Lua Tests'
version = ''
release = '0.1'
copyright = '2018, djungelorm'

master_doc = 'index'
source_suffix = '.rst'
extensions = ['redjack.sphinx.lua']

pygments_style = 'sphinx'

nitpick_ignore = [
]
13 changes: 13 additions & 0 deletions test/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. default-domain:: lua

.. class:: MyClass

Class description.

.. attribute:: my_attribute

An attribute

.. method:: my_method(foo, bar)

A method

0 comments on commit 0b7253b

Please sign in to comment.