• Top
    • Documentation
      • Xdoc
        • Undocumented
        • Save
        • Defsection
        • Markup
        • Preprocessor
        • Emacs-links
        • Defxdoc
        • Katex-integration
        • Constructors
        • Entities
        • Save-rendered
        • Add-resource-directory
          • Defxdoc+
          • Testing
          • Order-subtopics
          • Save-rendered-event
          • Archive-matching-topics
          • Missing-parents
          • Archive-xdoc
          • Xdoc-extend
          • Set-default-parents
          • Defpointer
          • Defxdoc-raw
          • Xdoc-tests
          • Xdoc-prepend
          • Defsection-progn
          • Gen-xdoc-for-file
        • ACL2-doc
        • Pointers
        • Doc
        • Documentation-copyright
        • Args
        • ACL2-doc-summary
        • Finding-documentation
        • Broken-link
      • Books
      • Recursion-and-induction
      • Boolean-reasoning
      • Projects
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Xdoc

    Add-resource-directory

    Tell xdoc about directories of resources (e.g., images, PDF files, etc.) that should be copied into manuals.

    Occasionally you may wish to include images or other files within an XDOC documentation topic. For this to work, XDOC's save command needs to know about these files so that it can copy them into the manual it produces. The add-resource-directory command lets you tell XDOC which directories to copy and what to name them.

    Example

    Suppose that in the vl library there are some images that we want to include in the manual. We can put these images into a directory, say images, and then do:

    (xdoc::add-resource-directory "vl" "images")

    This will cause the save command to copy everything from the images directory into the res/vl directory of our manual. To refer to these images, we can then write markup such as:

    <img src="res/vl/logo.jpg"/>

    These resource directories might also contain files other than images, for instance, PDF files. You can at provide hyperlinks to these files by just linking into the res directory, for instance:

    <a href="res/vl/slides.pdf">See the Slides!</a>

    General form

    (xdoc::add-resource-directory dirname path)
    • dirname controls where the directory will be placed in within the manual's res directory. In the example above, the dirname is "vl" so the files will be copied into "res/vl".
    • path controls where the files will be copied from. We recommend always using a simple path such as the name of an immediate subdirectory.

    Working example

    The directory books/xdoc/centaur contains a centaur-logo.png file. The file xdoc/topics.lisp adds this directory as a resource directory. If all is well, you should see the logo below: