Giter Site home page Giter Site logo

sphinx-confluence's People

Contributors

bpandola avatar ikeeip avatar jdillard avatar laqie avatar n-elloco avatar nugend avatar phobos1 avatar rastaman avatar spyoungtech avatar terrabite3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sphinx-confluence's Issues

make json not outputting in Confluence format

When I do make html the output is in the Confluence storage format. However, this is not the case for make json. It appears that there is no translation occurring. May be related to changes made in #12

Making the following change to the setup function seems to correct this...

...
    if LooseVersion(sphinx.__version__) >= LooseVersion("1.4"):
        app.set_translator("html", HTMLConfluenceTranslator)
        app.set_translator('json', HTMLConfluenceTranslator) # make it work for json, too.
...

Although a separate issue... I also tried doing sphinx-build -b json_conf but got the following exception.

Traceback (most recent call last):
  File "/Users/spenceryoung/ISS/lib/python3.6/site-packages/sphinx/cmdline.py", line 305, in main
    opts.warningiserror, opts.tags, opts.verbosity, opts.jobs)
  File "/Users/spenceryoung/ISS/lib/python3.6/site-packages/sphinx/application.py", line 226, in __init__
    self.builder = self.create_builder(buildername)
  File "/Users/spenceryoung/ISS/lib/python3.6/site-packages/sphinx/application.py", line 306, in create_builder
    return self.registry.create_builder(self, name)
  File "/Users/spenceryoung/ISS/lib/python3.6/site-packages/sphinx/registry.py", line 82, in create_builder
    return self.builders[name](app)
  File "/Users/spenceryoung/ISS/lib/python3.6/site-packages/sphinx_confluence/__init__.py", line 59, in __init__
    self.translator_class = HTMLConfluenceTranslator
AttributeError: can't set attribute

Exception occurred:
  File "/Users/spenceryoung/ISS/lib/python3.6/site-packages/sphinx_confluence/__init__.py", line 59, in __init__
    self.translator_class = HTMLConfluenceTranslator
AttributeError: can't set attribute

I am using Sphinx 1.6.5

Modify document hierarchy in confluence

Hey! We started using sphinx-confluence and it so far it has been great.

One feature we are missing is to structure the pages in a hierarchy that follows the documentation. Normally, sphinx produces an index that is usually shown on the side bar. This tool currently uploads all pages as children of one page, which results in a flat index, loosing the hierarchy encoded in the source rst/md files.

Would it be possible to upload them following a hierarchy?

I am currently planning on doing that with my own script to shuffle the pages after uploaded, but any pointers so I can help would be appreciated.

Doc request - how do I get this into confluence?

Can you do a write up or blog post on how you go from the json output to confluence? I can take my sphinx documentation and generate build/json/*.fjson files and I've read through the document storage format. But at this point, I'm struggling.

Do create a new page you do this:

curl -u admin:admin -X POST -H 'Content-Type: application/json' --data-binary @filename.json"  http://localhost:8080/confluence/rest/api/content/ | python -mjson.tool

And the content of that file looks like so:

{
    "body": {
        "storage": {
            "representation": "storage",
            "value": "<p>This is a new page</p>"
        }
    },
    "space": {
        "key": "TST"
    },
    "title": "new page",
    "type": "page"
}

Whereas the json out put would look like this:


{
    "alabaster_version": "0.7.6",
    "body": "<p>this is a new page</p>",
    "current_page_name": "index",
    "customsidebar": null,
    "display_toc": true,
    "meta": {},
    "metatags": "",
    "next": null,
    "parents": [],
    "prev": null,
    "rellinks": [
        [
            "genindex",
            "General Index",
            "I",
            "index"
        ]
    ],
    "sidebars": null,
    "sourcename": "index.txt",
    "title": "A New Page",
    "toc": "<ul>\n<li><a class=\"reference internal\" href=\"#\">New Page</a></li>\n</ul>\n"
}

It looks like what I have to do is create a tool to loop over files ending in .fjson, extract the body tag and create a body['storage']['value'] tag, but I feel like we're missing something. Shouldn't these json files be in the confluence format already, missing only space key (or better yet, we can configure the space key at build)?

Multiple page support is missing?!

Is it correct that this plugin is only able to build a single file (the master index file) and not linked/mentioned ones in toctree directives?

If I try to use it, sphinx claims that all my documentation files are not part of a toctree and therefore they get not build.
I guess this is because the toctree directives is overwritten by this extension.
Any ideas how to avoid this?

Doc unclear on Confluence Storage Format

The README.md "How use it" section says that after installing the plugin and building html or json, "the results must be in Confluence Storage Format". Is there a step that must be taken to convert to this format, or something that needs to be added to to the config file for confluence-publisher?

Sphinx in 1.5.1 version set html_translator_class as deprecated

Sphinx in 1.5.1 version set html_translator_class as deprecated

This diff should fix this:

diff --git a/sphinx_confluence/__init__.py b/sphinx_confluence/__init__.py
index 1c6eb3d..322c662 100644
--- a/sphinx_confluence/__init__.py
+++ b/sphinx_confluence/__init__.py
@@ -543,7 +543,7 @@ def setup(app):
     app.config.html_theme_path = [get_path()]
     app.config.html_theme = 'confluence'
     app.config.html_scaled_image_link = False
-    app.config.html_translator_class = 'sphinx_confluence.HTMLConfluenceTranslator'
+    app.set_translator("HTMLConfluenceTranslator", HTMLConfluenceTranslator)
     app.config.html_add_permalinks = ''
 
     jira_issue = JiraIssueRole('jira_issue', nodes.Inline)

Source:
http://www.sphinx-doc.org/en/1.5.1/changes.html
html_translator_class is now deprecated. Use Sphinx.set_translator() API instead.

document uploading to confluence

While this module converts Sphinx documentation into so called internal storage format used by Confluence its readme page is missing to give any information regarding how someone would be able to upload these to Confluence (preferably in a an automated way).

Doesn't support automodule

Docs that use automodule aren't currently supported. I get the following error: ERROR: Unknown directive type "automodule".

toctree not taken info account

When running make singlehtml

I am getting the following output

Running Sphinx v1.7.4
WARNING: while setting up extension sphinx_confluence: directive 'toctree' is already registered, it will be overridden
making output directory...
loading pickled environment... not yet created
building [mo]: targets for 0 po files that are out of date
building [singlehtml]: all documents
updating environment: 11 added, 0 changed, 0 removed
reading sources... [100%] scope                                  

The result for me is that only the main page it taken into account for the content generation and that the toctree is not taken into account.

My setup (normally) uses the sphinx_rdt_theme

AttributeError: 'StandaloneHTMLBuilder' object has no attribute 'has_title'

Hello!
I receive a error when I trying to convert our documentation with your plugin. May be this log will help you to find a problem:

# Sphinx version: 1.3.3
# Python version: 2.7.5+ (CPython)
# Docutils version: 0.12 release
# Jinja2 version: 2.8
# Last messages:
#   /home/shmele/project/src/docs/source/modules/one/forms.rst:: WARNING: document isn't included in any toctree
#   /home/shmele/project/src/docs/source/modules/one/models.rst:: WARNING: document isn't included in any toctree
#   /home/shmele/project/src/docs/source/modules/one/reports.rst:: WARNING: document isn't included in any toctree
#   /home/shmele/project/src/docs/source/modules/two.rst:: WARNING: document isn't included in any toctree
#   /home/shmele/project/src/docs/source/modules/three.rst:: WARNING: document isn't included in any toctree
#   /home/shmele/project/src/docs/source/modules/four.rst:: WARNING: document isn't included in any toctree
#   done
#   preparing documents...
#   done
#   writing output... [  6%] glossary
# Loaded extensions:
#   sphinx.ext.autodoc (1.3.3) from /home/shmele/project/local/lib/python2.7/site-packages/sphinx/ext/autodoc.pyc
#   sphinx.ext.intersphinx (1.3.3) from /home/shmele/project/local/lib/python2.7/site-packages/sphinx/ext/intersphinx.pyc
#   sphinx.ext.doctest (1.3.3) from /home/shmele/project/local/lib/python2.7/site-packages/sphinx/ext/doctest.pyc
#   alabaster (0.7.6) from /home/shmele/project/local/lib/python2.7/site-packages/alabaster/__init__.pyc
#   sphinx.ext.viewcode (1.3.3) from /home/shmele/project/local/lib/python2.7/site-packages/sphinx/ext/viewcode.pyc
#   sphinx.ext.coverage (1.3.3) from /home/shmele/project/local/lib/python2.7/site-packages/sphinx/ext/coverage.pyc
#   sphinx.ext.todo (1.3.3) from /home/shmele/project/local/lib/python2.7/site-packages/sphinx/ext/todo.pyc
#   sphinx_confluence (unknown version) from /home/shmele/project/local/lib/python2.7/site-packages/sphinx_confluence/__init__.pyc
Traceback (most recent call last):
  File "/home/shmele/project/local/lib/python2.7/site-packages/sphinx/cmdline.py", line 240, in main
    app.build(opts.force_all, filenames)
  File "/home/shmele/project/local/lib/python2.7/site-packages/sphinx/application.py", line 266, in build
    self.builder.build_update()
  File "/home/shmele/project/local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 252, in build_update
    'out of date' % len(to_build))
  File "/home/shmele/project/local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 323, in build
    self.write(docnames, list(updated_docnames), method)
  File "/home/shmele/project/local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 361, in write
    self._write_serial(sorted(docnames), warnings)
  File "/home/shmele/project/local/lib/python2.7/site-packages/sphinx/builders/__init__.py", line 369, in _write_serial
    self.write_doc(docname, doctree)
  File "/home/shmele/project/local/lib/python2.7/site-packages/sphinx/builders/html.py", line 439, in write_doc
    self.docwriter.write(doctree, destination)
  File "/home/shmele/project/local/lib/python2.7/site-packages/docutils/writers/__init__.py", line 80, in write
    self.translate()
  File "/home/shmele/project/local/lib/python2.7/site-packages/sphinx/writers/html.py", line 53, in translate
    self.document.walkabout(visitor)
  File "/home/shmele/project/local/lib/python2.7/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/home/shmele/project/local/lib/python2.7/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/home/shmele/project/local/lib/python2.7/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/home/shmele/project/local/lib/python2.7/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/home/shmele/project/local/lib/python2.7/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/home/shmele/project/local/lib/python2.7/site-packages/docutils/nodes.py", line 166, in walkabout
    visitor.dispatch_visit(self)
  File "/home/shmele/project/local/lib/python2.7/site-packages/docutils/nodes.py", line 1882, in dispatch_visit
    return method(node)
  File "/home/shmele/project/local/lib/python2.7/site-packages/sphinx_confluence/__init__.py", line 258, in visit_reference
    if node.get('internal') and self.builder.has_title(self.document):
AttributeError: 'StandaloneHTMLBuilder' object has no attribute 'has_title'

It my first time, when I trying to use your extension.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.