From 42fe22bd7865f14e13c11b9515cdeba2bb487896 Mon Sep 17 00:00:00 2001 From: Jamie Willis Date: Thu, 4 Jan 2024 23:11:29 +0000 Subject: [PATCH] fix the version selector by disabling PathTranslator extension and versioning files not directories --- docs/api-guide/Parsley.md | 1 + docs/api-guide/README.md | 1 + docs/api-guide/character.md | 1 + docs/api-guide/combinator.md | 1 + docs/api-guide/debug.md | 1 + docs/api-guide/directory.conf | 3 ++- docs/api-guide/errors/ErrorBuilder.md | 1 + docs/api-guide/errors/combinator.md | 1 + docs/api-guide/errors/patterns.md | 1 + docs/api-guide/errors/tokenextractors.md | 1 + docs/api-guide/expr/chain.md | 1 + docs/api-guide/expr/infix.md | 1 + docs/api-guide/expr/precedence.md | 1 + docs/api-guide/generic.md | 1 + docs/api-guide/position.md | 1 + docs/api-guide/state.md | 1 + docs/api-guide/syntax.md | 1 + docs/api-guide/token/Lexer.md | 1 + docs/api-guide/token/descriptions.md | 1 + docs/api-guide/token/errors.md | 1 + docs/tutorial/advanced-error-messages.md | 1 + docs/tutorial/basics-of-combinators.md | 1 + docs/tutorial/building-expression-parsers.md | 1 + docs/tutorial/customising-error-messages.md | 1 + docs/tutorial/directory.conf | 3 ++- docs/tutorial/effective-lexing.md | 1 + docs/tutorial/effective-whitespace-parsing.md | 1 + docs/tutorial/interlude-1-haskell.md | 1 + docs/tutorial/parser-bridge-pattern.md | 1 + project/ParsleySitePlugin.scala | 4 ++-- 30 files changed, 33 insertions(+), 4 deletions(-) diff --git a/docs/api-guide/Parsley.md b/docs/api-guide/Parsley.md index 70e280286..47dd7d5e9 100644 --- a/docs/api-guide/Parsley.md +++ b/docs/api-guide/Parsley.md @@ -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." diff --git a/docs/api-guide/README.md b/docs/api-guide/README.md index d0510c57b..f367e1bb1 100644 --- a/docs/api-guide/README.md +++ b/docs/api-guide/README.md @@ -1,4 +1,5 @@ {% +laika.versioned = true helium.site.pageNavigation.enabled = false laika.site.metadata.description = "This page outlines the API guide." %} diff --git a/docs/api-guide/character.md b/docs/api-guide/character.md index b9f49413a..0fba4fdf3 100644 --- a/docs/api-guide/character.md +++ b/docs/api-guide/character.md @@ -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." diff --git a/docs/api-guide/combinator.md b/docs/api-guide/combinator.md index ca2ec0085..08a844c2d 100644 --- a/docs/api-guide/combinator.md +++ b/docs/api-guide/combinator.md @@ -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." diff --git a/docs/api-guide/debug.md b/docs/api-guide/debug.md index 3c1edad3f..fde10a2ac 100644 --- a/docs/api-guide/debug.md +++ b/docs/api-guide/debug.md @@ -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." diff --git a/docs/api-guide/directory.conf b/docs/api-guide/directory.conf index c950c0969..078dbd4b3 100644 --- a/docs/api-guide/directory.conf +++ b/docs/api-guide/directory.conf @@ -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 diff --git a/docs/api-guide/errors/ErrorBuilder.md b/docs/api-guide/errors/ErrorBuilder.md index 4e132556d..18d75d6c8 100644 --- a/docs/api-guide/errors/ErrorBuilder.md +++ b/docs/api-guide/errors/ErrorBuilder.md @@ -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." diff --git a/docs/api-guide/errors/combinator.md b/docs/api-guide/errors/combinator.md index f52a6c98f..4c1b3620a 100644 --- a/docs/api-guide/errors/combinator.md +++ b/docs/api-guide/errors/combinator.md @@ -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." diff --git a/docs/api-guide/errors/patterns.md b/docs/api-guide/errors/patterns.md index 5837f6ae6..2c422340d 100644 --- a/docs/api-guide/errors/patterns.md +++ b/docs/api-guide/errors/patterns.md @@ -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." diff --git a/docs/api-guide/errors/tokenextractors.md b/docs/api-guide/errors/tokenextractors.md index e29f2caf0..0de1950b8 100644 --- a/docs/api-guide/errors/tokenextractors.md +++ b/docs/api-guide/errors/tokenextractors.md @@ -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." diff --git a/docs/api-guide/expr/chain.md b/docs/api-guide/expr/chain.md index e304bed95..02ae624bd 100644 --- a/docs/api-guide/expr/chain.md +++ b/docs/api-guide/expr/chain.md @@ -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." diff --git a/docs/api-guide/expr/infix.md b/docs/api-guide/expr/infix.md index d02794d9e..78d0ec0be 100644 --- a/docs/api-guide/expr/infix.md +++ b/docs/api-guide/expr/infix.md @@ -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." diff --git a/docs/api-guide/expr/precedence.md b/docs/api-guide/expr/precedence.md index 565fbe535..8af99c717 100644 --- a/docs/api-guide/expr/precedence.md +++ b/docs/api-guide/expr/precedence.md @@ -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." diff --git a/docs/api-guide/generic.md b/docs/api-guide/generic.md index 60e8ed89d..39b8434c3 100644 --- a/docs/api-guide/generic.md +++ b/docs/api-guide/generic.md @@ -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." diff --git a/docs/api-guide/position.md b/docs/api-guide/position.md index 23ac81428..3f5ab54ce 100644 --- a/docs/api-guide/position.md +++ b/docs/api-guide/position.md @@ -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." diff --git a/docs/api-guide/state.md b/docs/api-guide/state.md index b5a410005..519e244e7 100644 --- a/docs/api-guide/state.md +++ b/docs/api-guide/state.md @@ -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." diff --git a/docs/api-guide/syntax.md b/docs/api-guide/syntax.md index 146912d9e..0c126b99e 100644 --- a/docs/api-guide/syntax.md +++ b/docs/api-guide/syntax.md @@ -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." diff --git a/docs/api-guide/token/Lexer.md b/docs/api-guide/token/Lexer.md index d45f0e6be..1b5480acf 100644 --- a/docs/api-guide/token/Lexer.md +++ b/docs/api-guide/token/Lexer.md @@ -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." diff --git a/docs/api-guide/token/descriptions.md b/docs/api-guide/token/descriptions.md index 012633ffb..de4ddda32 100644 --- a/docs/api-guide/token/descriptions.md +++ b/docs/api-guide/token/descriptions.md @@ -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." diff --git a/docs/api-guide/token/errors.md b/docs/api-guide/token/errors.md index 7334180fa..5340f8c34 100644 --- a/docs/api-guide/token/errors.md +++ b/docs/api-guide/token/errors.md @@ -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." diff --git a/docs/tutorial/advanced-error-messages.md b/docs/tutorial/advanced-error-messages.md index 3214aadc3..d22f9f815 100644 --- a/docs/tutorial/advanced-error-messages.md +++ b/docs/tutorial/advanced-error-messages.md @@ -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 diff --git a/docs/tutorial/basics-of-combinators.md b/docs/tutorial/basics-of-combinators.md index d2d03c099..73faf5a57 100644 --- a/docs/tutorial/basics-of-combinators.md +++ b/docs/tutorial/basics-of-combinators.md @@ -1,4 +1,5 @@ {% +laika.versioned = true laika.site.metadata.description = "How combinators work at a basic level." %} diff --git a/docs/tutorial/building-expression-parsers.md b/docs/tutorial/building-expression-parsers.md index 6ad2f43aa..9f1a0a790 100644 --- a/docs/tutorial/building-expression-parsers.md +++ b/docs/tutorial/building-expression-parsers.md @@ -1,4 +1,5 @@ {% +laika.versioned = true laika.site.metadata.description = "How to handle left-recursion and precedence in a parser." %} # Building Expression Parsers diff --git a/docs/tutorial/customising-error-messages.md b/docs/tutorial/customising-error-messages.md index 25b40f17d..55886fb95 100644 --- a/docs/tutorial/customising-error-messages.md +++ b/docs/tutorial/customising-error-messages.md @@ -1,4 +1,5 @@ {% +laika.versioned = true laika.site.metadata.description = "How to customise error messages to make them more informative." %} # Customising Error Messages diff --git a/docs/tutorial/directory.conf b/docs/tutorial/directory.conf index 7d4086938..807433411 100644 --- a/docs/tutorial/directory.conf +++ b/docs/tutorial/directory.conf @@ -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 diff --git a/docs/tutorial/effective-lexing.md b/docs/tutorial/effective-lexing.md index 978ec10ee..219551b94 100644 --- a/docs/tutorial/effective-lexing.md +++ b/docs/tutorial/effective-lexing.md @@ -1,4 +1,5 @@ {% +laika.versioned = true laika.site.metadata.description = "How to handle low-level tokenisation in a parser." %} # Effective Lexing diff --git a/docs/tutorial/effective-whitespace-parsing.md b/docs/tutorial/effective-whitespace-parsing.md index 31821a28b..8132cae6b 100644 --- a/docs/tutorial/effective-whitespace-parsing.md +++ b/docs/tutorial/effective-whitespace-parsing.md @@ -1,4 +1,5 @@ {% +laika.versioned = true laika.site.metadata.description = "Conventions for how a parser should deal with whitespace." %} # Effective Whitespace Parsing diff --git a/docs/tutorial/interlude-1-haskell.md b/docs/tutorial/interlude-1-haskell.md index 74700a2e2..ec91024c1 100644 --- a/docs/tutorial/interlude-1-haskell.md +++ b/docs/tutorial/interlude-1-haskell.md @@ -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 diff --git a/docs/tutorial/parser-bridge-pattern.md b/docs/tutorial/parser-bridge-pattern.md index c15f57ab8..911c1f869 100644 --- a/docs/tutorial/parser-bridge-pattern.md +++ b/docs/tutorial/parser-bridge-pattern.md @@ -1,4 +1,5 @@ {% +laika.versioned = true laika.site.metadata.description = "How to abstract away result construction from parsing." %} diff --git a/project/ParsleySitePlugin.scala b/project/ParsleySitePlugin.scala index 8d1715c10..b19d0ab3a 100644 --- a/project/ParsleySitePlugin.scala +++ b/project/ParsleySitePlugin.scala @@ -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: _*) @@ -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("") => fmt