Skip to content

Major: support rootpages (README.md) and custom pagesort based on in-file metadata #26

Closed
wants to merge 22 commits into from

2 participants

@Martimiz
  • Add rootpages like README.md to the toplevel sidemenu (optionally disable)
  • Enable custom pagesort based on custom metadata in the files (optionally disable) Also enables the use of other metadata, like Title
  • Documentation for both features

Note: Both features also available in separate branches.

See also: https://groups.google.com/forum/#!searchin/silverstripe-dev/martimiz/silverstripe-dev/d8jTpkQhT88/JjwikBCxscwJ

Martimiz added some commits Feb 1, 2013
@Martimiz Martimiz Merge remote-tracking branch 'upstream/master' into search-20130201 365c30c
@Martimiz Martimiz Enabling/disabling rootpages globally and/or per entity
This sets up the basic functionality for enabling or disabling the
display of rootpages: valid non-localized pages that live in an
entity's root
20d153a
@Martimiz Martimiz Setting up registration to allow rootpaths
Registration path will point to the entity root by default, and will
automatically configure the documentaition path as well as the optional
rootpath.

Registering the docs path is still possible for reasons of backwards
compatibility.
8a69979
@Martimiz Martimiz Inject rootpages into the sidemenu
Rootpages take their place in the toplevel sidemenu as if they are part
of the localized files
7fde048
@Martimiz Martimiz Find the requested page - localized or root
If the rootpage is selected, it needs to be displayed. The
DocumentationViewer::getPage and ::LocationExist() methods are adapted,
as well as DocumentationService::find_page() and ::find_page_recursive()
094843e
@Martimiz Martimiz Allow for README index file if index doesn't exist de01258
@Martimiz Martimiz Update DocumentViewer test to comply with natcasesort
Using natcasesort on menu-items will sort case-insensitive, where in
the original natsort was case-sensitive, causing some confusion...
bee3467
@Martimiz Martimiz Merge remote-tracking branch 'upstream/master' into rootpages 2cf6a5f
@Martimiz Martimiz Set empty version to 'current'
On older manual or custom registrations the version may be set to ''
(empty). This should automatically be converted to current.
5a3d0f4
@Martimiz Martimiz Added information about rootpages and permissions
Information about rootpages and how to enable/disable their display
globally or per entity/module.
d6d6e6b
@Martimiz Martimiz Merge remote-tracking branch 'upstream/master' into rootpages ae4c513
@Martimiz Martimiz Add property, getter and setter for pagenumbering 021e41c
@Martimiz Martimiz Set up default pagenumbering on pages 68e6838
@Martimiz Martimiz Add property to enable/disable reading metadata from file
Meta data are key/value pairs wrapped in a HTML comment block at the
head of the file
ddf799c
@Martimiz Martimiz If metadata enabled, read it from file and resort pages
Only resort if there is a chance of custom page sorting, avoiding
overhead when not.
6b4ed0e
@Martimiz Martimiz Add documentation for metadata and pagenumbering 50bc738
@Martimiz Martimiz FIX: read metadata from the top of the file only cfc0f3e
@Martimiz Martimiz Enablemetadata by default 0074fd1
@Martimiz Martimiz FIX: Use natcasesort 074d178
@Martimiz Martimiz Separate default pagesort for docs and rootfiles
Most cases you'd probably want the rootfiles (like README) to be
located at the bottom of the menu.
f9e44fa
@Martimiz Martimiz merge pagesort into rootpages 5ce2c0a
@Martimiz Martimiz Merge remote-tracking branch 'upstream/master' into rootpages-pagesort 13e8fe0
@chillu
SilverStripe Ltd. member
chillu commented May 14, 2013

Can we switch the metadata definition from pseudo-html comments to a more standard one? See https://github.com/fletcher/MultiMarkdown/wiki/MultiMarkdown-Syntax-Guide

@Martimiz

Sure, I suppose... As markdown they are standard I think, meant to hide content even on Github. The reason I did it this way is that I wanted them not to be displayed...

Would be nice if the docsviewer supported MultiMarkdown - I remember looking into it and thinking that would be too much for me :(

@chillu
SilverStripe Ltd. member
chillu commented May 17, 2013

Any update on this?

As a general remark, pull requests should never contain merge commits, it makes it much harder to rebase them. Simply rebase your pull request branch against the branch you branched off from. This changes the commit hashes, but that's OK for pull requests. See http://doc.silverstripe.org/framework/en/trunk/misc/contributing/code

If you have time, can you please squash the commits? It's probably easiest to git cherrypick them into a new branch, rather than deal with the merge commits. But only if you have time, I'm keen on getting this PR (with the changes to markdown metadata format) into the module ASAP.

@Martimiz Martimiz closed this Jun 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.