Skip to content

Commit

Permalink
fix the version selector by disabling PathTranslator extension and ve…
Browse files Browse the repository at this point in the history
…rsioning files not directories
  • Loading branch information
j-mie6 committed Jan 4, 2024
1 parent 2db4739 commit 42fe22b
Show file tree
Hide file tree
Showing 30 changed files with 33 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/api-guide/Parsley.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`parsley.Parsley`"
parsley.tabname = "Parsley"
laika.site.metadata.description = "This page describes the main API of Parsley."
Expand Down
1 change: 1 addition & 0 deletions docs/api-guide/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
helium.site.pageNavigation.enabled = false
laika.site.metadata.description = "This page outlines the API guide."
%}
Expand Down
1 change: 1 addition & 0 deletions docs/api-guide/character.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`parsley.character`"
parsley.tabname = "Parsing Characters (parsley.character)"
laika.site.metadata.description = "This page describes how to read characters."
Expand Down
1 change: 1 addition & 0 deletions docs/api-guide/combinator.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`parsley.combinator`"
parsley.tabname = "Additional Combinators (parsley.combinator)"
laika.site.metadata.description = "This page describes additional helpful combinators."
Expand Down
1 change: 1 addition & 0 deletions docs/api-guide/debug.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`parsley.debug`"
parsley.tabname = "Basic Debug Combinators (parsley.debug)"
laika.site.metadata.description = "This page describes the built-in basic debugging combinators."
Expand Down
3 changes: 2 additions & 1 deletion docs/api-guide/directory.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ laika.navigationOrder = [
token
errors
]
laika.versioned = true
# FIXME: We don't want this on actually, it screws with the version selector!
#laika.versioned = true
1 change: 1 addition & 0 deletions docs/api-guide/errors/ErrorBuilder.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`ErrorBuilder`"
parsley.tabname = "Constructing Custom Errors (parsley.errors.ErrorBuilder)"
laika.site.metadata.description = "This page describes how to customise the error type."
Expand Down
1 change: 1 addition & 0 deletions docs/api-guide/errors/combinator.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`combinator`"
parsley.tabname = "Error Message Combinators (parsley.errors.combinator)"
laika.site.metadata.description = "This page describes how to generate informative errors."
Expand Down
1 change: 1 addition & 0 deletions docs/api-guide/errors/patterns.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`patterns`"
parsley.tabname = "Error Message Patterns (parsley.errors.patterns)"
laika.site.metadata.description = "This page describes how to generate informative errors."
Expand Down
1 change: 1 addition & 0 deletions docs/api-guide/errors/tokenextractors.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`tokenextractors`"
parsley.tabname = "Token Extraction in ErrorBuilder (parsley.errors.tokenextractors)"
laika.site.metadata.description = "This page describes how to customise the unexpected token of an error."
Expand Down
1 change: 1 addition & 0 deletions docs/api-guide/expr/chain.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`chain`"
parsley.tabname = "Chain Combinators"
laika.site.metadata.description = "This page describes how to chain together values and operators."
Expand Down
1 change: 1 addition & 0 deletions docs/api-guide/expr/infix.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`infix`"
parsley.tabname = "Infix Chain Combinators"
laika.site.metadata.description = "This page describes how to chain together values and operators."
Expand Down
1 change: 1 addition & 0 deletions docs/api-guide/expr/precedence.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`precedence`"
parsley.tabname = "Precedence Combinators"
laika.site.metadata.description = "This page describes how to build precedence tables."
Expand Down
1 change: 1 addition & 0 deletions docs/api-guide/generic.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`parsley.genericbridges`"
parsley.tabname = "Generic Bridges (parsley.genericbridges)"
laika.site.metadata.description = "This page describes how to use generic bridges to factor code."
Expand Down
1 change: 1 addition & 0 deletions docs/api-guide/position.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`parsley.position`"
parsley.tabname = "Position Combinators (parsley.position)"
laika.site.metadata.description = "This page describes how to get position information."
Expand Down
1 change: 1 addition & 0 deletions docs/api-guide/state.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`parsley.registers`"
parsley.tabname = "Context-Sensitive Parsing (parsley.registers)"
laika.site.metadata.description = "This page describes how to thread custom state through a parser."
Expand Down
1 change: 1 addition & 0 deletions docs/api-guide/syntax.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`parsley.implicits`"
parsley.tabname = "Syntactic Extensions (parsley.implicits)"
laika.site.metadata.description = "This page describes Parsley's syntactic extensions."
Expand Down
1 change: 1 addition & 0 deletions docs/api-guide/token/Lexer.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`Lexer`"
parsley.tabname = "Lexer (parsley.token.Lexer)"
laika.site.metadata.description = "This page describes how Parsley's lexer works."
Expand Down
1 change: 1 addition & 0 deletions docs/api-guide/token/descriptions.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`descriptions`"
parsley.tabname = "Configuring the Lexer (parsley.token.descriptions)"
laika.site.metadata.description = "This page describes how to configure a custom language."
Expand Down
1 change: 1 addition & 0 deletions docs/api-guide/token/errors.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.title = "`errors`"
parsley.tabname = "Configuring Errors (parsley.token.errors)"
laika.site.metadata.description = "This page describes how to change the errors generated by the Lexer."
Expand Down
1 change: 1 addition & 0 deletions docs/tutorial/advanced-error-messages.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.site.metadata.description = "How to employ more advanced techniques to make error messages context-dependent."
%}
# Advanced Error Messages
Expand Down
1 change: 1 addition & 0 deletions docs/tutorial/basics-of-combinators.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.site.metadata.description = "How combinators work at a basic level."
%}

Expand Down
1 change: 1 addition & 0 deletions docs/tutorial/building-expression-parsers.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.site.metadata.description = "How to handle left-recursion and precedence in a parser."
%}
# Building Expression Parsers
Expand Down
1 change: 1 addition & 0 deletions docs/tutorial/customising-error-messages.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.site.metadata.description = "How to customise error messages to make them more informative."
%}
# Customising Error Messages
Expand Down
3 changes: 2 additions & 1 deletion docs/tutorial/directory.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ laika.autonumbering = {
scope: sections
depth: 3
}
laika.versioned = true
# FIXME: We don't want this on actually, it screws with the version selector!
#laika.versioned = true
1 change: 1 addition & 0 deletions docs/tutorial/effective-lexing.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.site.metadata.description = "How to handle low-level tokenisation in a parser."
%}
# Effective Lexing
Expand Down
1 change: 1 addition & 0 deletions docs/tutorial/effective-whitespace-parsing.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.site.metadata.description = "Conventions for how a parser should deal with whitespace."
%}
# Effective Whitespace Parsing
Expand Down
1 change: 1 addition & 0 deletions docs/tutorial/interlude-1-haskell.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.site.metadata.description = "An in-depth look at optimising a parser for a sub-set of Haskell."
%}
# Interlude 1: Building a Parser for Haskell
Expand Down
1 change: 1 addition & 0 deletions docs/tutorial/parser-bridge-pattern.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{%
laika.versioned = true
laika.site.metadata.description = "How to abstract away result construction from parsing."
%}

Expand Down
4 changes: 2 additions & 2 deletions project/ParsleySitePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ object ParsleySitePlugin extends AutoPlugin {
tlSiteKeepFiles := true,
laikaExtensions ++= Seq(
Extensions.backticksToCode,
Extensions.noVersionedIndex,
//Extensions.noVersionedIndex, // FIXME: evil extension breaks version selection, dunno why yet
),
laikaConfig := LaikaConfig.defaults.withConfigValue(
LinkConfig.empty.addApiLinks(tlSiteApiUrl.value.map(url => ApiLinks(baseUri = url.toExternalForm)).toSeq: _*)
Expand Down Expand Up @@ -343,8 +343,8 @@ object Extensions {
override def translate(input: RelativePath): RelativePath = if (input.name == "index.html") input else delegate.translate(input)
override def getAttributes(path: Path): Option[PathAttributes] = delegate.getAttributes(path)
override def forReferencePath(path: Path): PathTranslator = createTranslator(delegate.forReferencePath(path))

}

private object isTitleText {
def unapply(fmt: TagFormatter): Option[TagFormatter] = fmt.parents.headOption.collect {
case TemplateSpanSequence(TemplateString(cousin, _) +: _, _) if cousin.endsWith("<title>") => fmt
Expand Down

0 comments on commit 42fe22b

Please sign in to comment.