It would be really nice to have a wiki macro that could pull content from a repository.
If we had this, we could include general end-user usage docs of the Allura platform (as opposed to the more operator geared docs at allura.sf.net), which would be distributed along with the Allura platform. This would also make it easier for general Allura docs to live side-by-side in a wiki that also contains more site specific information (like SourceForge).
I believe this would also be a viable alternative to feature requests such as https://sourceforge.net/p/forge/feature-requests/58/ and https://sourceforge.net/p/forge/feature-requests/31/
We can extend the
[include]
macro so that in addition to embedding from another wiki page, it could pull in markdown from a specified repo & path & optional repo revision.Closed #561.
je/42cc_7168
Added 3 new parameters to
[[include]]
macro:Some usage examples:
This is pretty awesome! I love it that it is only a few dozen lines of code, reusing logic that's already elsewhere in Allura. Some feedback:
Project queries should always include the neighborhood (since the same shortname can be used in multiple nbhds).
M.Project.query.get(shortname=parts[0])
Probably use the current nbhd. We could enhance later if you want to reference across neighborhoods.Can you add a repo example or two to the "Includes" section of the markdown formatting help?
Minor: I wonder if the
app.repo.is_file
check could be avoided thus save a little time from hitting the repo twice. Could we just catch any error fromget_path()
or something like that?Oh, and also it seems you can remove the
|safe
from thetext
output sinceh.render_any_markup
andg.highlight
return a Markup object (aka string flagged as safe).Closed #569. Force-pushed
je/42cc_7168