page-types.mdwn 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. Regular pages are Markdown files with [[ikiwiki]] extensions. But there may be
  2. other file types you want to put on the wiki, for example:
  3. - Pages with other markup, e.g. *Creole*
  4. - Source code, e.g. *.pl* and *.py* files
  5. - Plain text without Markdown features
  6. - Custom file extensions and syntaxes
  7. - Non-page files, e.g. images
  8. The following sections explain how to use various page types. For non-page
  9. files, see the other [[editing/help]] pages.
  10. # Other Markup
  11. Currently Markdown is the only markup used for text pages, and I prefer that all
  12. pages are written consistently with the same markup, unless special features are
  13. required (e.g. TeX).
  14. New markup formats can be enabled by plugins if needed - ikiwiki supports
  15. several popular formats.
  16. # Source Code
  17. Using the [[ikiwiki/directive/format]] directive, it is possible to embed
  18. syntax-highlighted text inside pages. But in order to have while source files
  19. highlighted and rendered like regular wiki pages, i.e. with links and headers,
  20. their file types need to be added to the wiki setup file.
  21. Currently several common types are enabled, such as Perl and Python. More types
  22. can be easily added to the setup file. Then, just use the source files as-is in
  23. the wiki source tree and they will be rendered into highlighted wiki pages.
  24. # Plain Text
  25. There are two ways to create plain-text files: With ikiwiki and Markdown
  26. features, and without. The first option works just like when uploading source
  27. files, but without the syntax highlighting, i.e. "plain text" file type. By
  28. default the highlight plugin maps the *txt* extension to plain text, i.e. you
  29. can create *.txt* files and they'll be rendered into pages.
  30. For simple use, this setup works even if you don't want Markdown or WikiLinks
  31. in your file.
  32. For the second option, i.e. real plain-text without wiki features, the txt
  33. plugin should be enabled.
  34. It is also possible to have other extensions as plain-text file extensions, e.g.
  35. for special purpose files like license text (COPYING) or song lyrics. These
  36. extensions can be specified in the setup file. Several such extensions are
  37. already in use in this wiki, and are mentioned below.
  38. # Song Lyrics
  39. It is possible to create pages for song lyrics as-is, i.e. consecutive lines
  40. won't be merged into paragraphs and the lyrics will appear like in the source
  41. text. It works by adding a page with a __.lyrics__ extension.
  42. Lyrics pages are handled by the highlight plugin as plain-text files.
  43. Example: [[people/fr33domlover/song-lyrics/john_lennon/imagine.lyrics]]
  44. # IRC Logs
  45. It is possible to create pages for IRC logs, like the ones which can be exported
  46. by XChat. They will be highlighted. It works by adding a page with an __.irc__
  47. extension.
  48. IRC log pages are handled by the highlight plugin. Curretly they are highlighted
  49. as HTML pages because it's close enough to the log syntax to make the result
  50. readable, but it's not perfect.
  51. [[TODO|TODO/OPEN]] consider trying to develop GNU source-highlight support for
  52. ikiwiki
  53. [[TODO|TODO/OPEN]] write a syntax file for IRC logs, either for 'highlight' or for
  54. GNU source-highlight
  55. Work on the syntax highlighting is happening [[here|irc-log-highlight]].
  56. Example: [[TODO|TODO/OPEN]] add example link