-
Notifications
You must be signed in to change notification settings - Fork 31
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
confluence-space-key is not being picked up in markdown document #53
Comments
Some of the document properties are deferrable. For example, a page doesn't need to have an explicit parent, it is enough if it gets assigned a parent (explicitly, or via a root page ID, or via inheritance from an ancestor) at the time content is generated. If the page is evaluated in a context where it has to have a parent (e.g. when exporting a directory hierarchy), and it turns out that it does not, a run-time error is raised. Other document properties are overridable but not deferrable. For example, Confluence space key is a required parameter that you must set at the time the conversion is triggered. The value you set via the configuration options is the default Confluence space that you can in turn override in Markdown documents. If you don't override, the default space key is automatically applied. This ensures that all documents have a Confluence space key, and a run-time error due to missing space key is never triggered. Confluence space key could be made a deferrable property with some changes to the code. However, you can emulate the behavior if you set a dummy space key in environment variables. This is how unit and integration tests work in md2conf, they use an otherwise meaningless dummy space key. |
It would be nice if the space key as specified in the document is used instead of having to explicitly set one when running md2conf. Using a dummy space key is fine, but is confusing. Right now I'm setting the space key, both in the document and the environment, but find this duplicative. |
I am having the same issue. I am attempting to publish directories to Confluence, and want to set the space id at the document level. |
It should be possible to set space ID at the document level, and this should override the value set in environment variables. What has remained unsupported since this issue was originally opened is the ability to defer setting a space ID. Specifically, even if every document has a space ID assigned in the Markdown file, you are still required to configure space ID globally (e.g. in environment variables). If you are having issues overriding space ID, feel free to open a different issue. Let's keep this issue to the original feature request of a deferrable space ID configuration. (Unfortunately, this would entail more significant changes to the code, which is why it has been postponed for so long.) |
Hi - I'm trying to use this tool to publish a README.md to our enterprise Confluence. At the top of my README.md, I have the following:
When I run md2conf README.md, the confluence-space-key does not get picked up, I get an error:
md2conf.properties.ConfluenceError: Confluence space key not specified
I have to specify the space key as an environment variable, CONFLUENCE_SPACE_KEY.
I traced through the code and it appears as though if the environment variable is not set, the markdown is not checked for 'confluence-space-key'.
I also noticed in
md2conf/md2conf/properties.py
Line 50 in 52af6dc
that self.space_key = opt_space_key is done 3 times in a row.
The text was updated successfully, but these errors were encountered: