@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Document wiki relative link syntax

Summary: Also make `../` work to start relative a link so I don't have to document it as `./../path`.

Test Plan:
- Used `./`, `../`. `./../`, and normal links (proper title pickup).
- Used bad links (red).
- Regenerated documentation:

{F1221692}

Reviewers: hach-que

Reviewed By: hach-que

Differential Revision: https://secure.phabricator.com/D15734

+25 -2
+2 -2
src/applications/phriction/markup/PhrictionRemarkupRule.php
··· 19 19 $link = trim($matches[1]); 20 20 21 21 // Handle relative links. 22 - if (substr($link, 0, 2) === './') { 22 + if ((substr($link, 0, 2) === './') || (substr($link, 0, 3) === '../')) { 23 23 $base = null; 24 24 $context = $this->getEngine()->getConfig('contextObject'); 25 25 if ($context !== null && $context instanceof PhrictionContent) { ··· 33 33 } 34 34 if ($base !== null) { 35 35 $base_parts = explode('/', rtrim($base, '/')); 36 - $rel_parts = explode('/', substr(rtrim($link, '/'), 2)); 36 + $rel_parts = explode('/', rtrim($link, '/')); 37 37 foreach ($rel_parts as $part) { 38 38 if ($part === '.') { 39 39 // Consume standalone dots in a relative path, and do
+23
src/docs/user/userguide/remarkup.diviner
··· 512 512 513 513 Make sure you sign and date your [[legal/Letter of Marque and Reprisal]]! 514 514 515 + By default, the link will render with the document title as the link name. 515 516 With a pipe (`|`), you can retitle the link. Use this to mislead your 516 517 opponents: 517 518 518 519 Check out these [[legal/boring_documents/ | exciting legal documents]]! 520 + 521 + Links to pages which do not exist are shown in red. Links to pages which exist 522 + but which the viewer does not have permission to see are shown with a lock 523 + icon, and the link will not disclose the page title. 524 + 525 + If you begin a link path with `./` or `../`, the remainder of the path will be 526 + evaluated relative to the current wiki page. For example, if you are writing 527 + content for the document `fruit/` a link to `[[./guava]]` is the same as a link 528 + to `[[fruit/guava]]` from elsewhere. 529 + 530 + Relative links may use `../` to transverse up the document tree. From the 531 + `produce/vegetables/` page, you can use `[[../fruit/guava]]` to link to the 532 + `produce/fruit/guava` page. 533 + 534 + Relative links do not work when used outside of wiki pages. For example, 535 + you can't use a relative link in a comment on a task, because there is no 536 + reasonable place for the link to start resolving from. 537 + 538 + When documents are moved, relative links are not automatically updated: they 539 + are preserved as currently written. After moving a document, you may need to 540 + review and adjust any relative links it contains. 541 + 519 542 520 543 = Literal Blocks = 521 544