Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-54394

CodeBlock macro should support file references as read-only code

    XMLWordPrintable

Details

    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      It would be very convenient if the CodeBlock macro would allow you to provide a file reference via URI, ideally with starting and ending line numbers. Obviously this would need to be read-only since you won't in general have any way to update the referenced file, but even read-only access would be VERY useful in building architectural wikis. 

       

      Some clarification: 

      The problem I am trying to avoid that when changes are made to the file that the code in the wiki was extracted from - those changes are not reflected in the wiki. What I want is for the CodeBlock to retrieve the lines in question from the current file and display them in on the page.  This should not pose any significant security concerns because you are only displaying source code (not executing it) and it can be escaped as needed to ensure it is clean. 

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              528f579e87e6 Joe Steele
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: