#7168 Wiki macro to load content from repository

asf_release_1.2.0
closed
nobody
General
2015-01-05
2014-02-12
Chris Tsai
No

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/

Discussion

  • Dave Brondsema
    Dave Brondsema
    2014-02-28

    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.

     
  • Dave Brondsema
    Dave Brondsema
    2014-03-07

    • labels: for-community --> for-community, 42cc
     
  • Closed #561. je/42cc_7168

    Added 3 new parameters to [[include]] macro:

    • repo
    • path
    • rev (optional)

    Some usage examples:

    [[include repo=t520 path=README]]
    
    [[include repo=test:ew-code path=/ew/forms.py rev=fa61e7]]
    
    [[include repo=test:ew-code path=/ew/forms.py]]
    
     
    • status: open --> code-review
     
  • Dave Brondsema
    Dave Brondsema
    2014-03-27

    • QA: Dave Brondsema
     
  • Dave Brondsema
    Dave Brondsema
    2014-03-28

    • status: code-review --> in-progress
     
  • Dave Brondsema
    Dave Brondsema
    2014-03-28

    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 from get_path() or something like that?

     
  • Dave Brondsema
    Dave Brondsema
    2014-03-28

    Oh, and also it seems you can remove the |safe from the text output since h.render_any_markup and g.highlight return a Markup object (aka string flagged as safe).

     
    • status: in-progress --> code-review
     
  • Closed #569. Force-pushed je/42cc_7168

     
  • Dave Brondsema
    Dave Brondsema
    2014-04-04

    • status: code-review --> closed
    • Milestone: limbo --> forge-apr-18
     
  • Dave Brondsema
    Dave Brondsema
    2015-01-05

    • Milestone: unreleased --> asf_release_1.2.0