Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix StringTemplate indent bug for snippets #86

Merged
merged 1 commit into from
May 8, 2017

Conversation

gsechaud
Copy link
Contributor

Resolve #84

Use the "NoIndentWriter" as a writer for each template

No matter how the theme is built (indentations or not), the generated html pages will be built in order to remove them.

@dwijnand
Copy link
Member

dwijnand commented Jan 13, 2017

@jrudolph / @ktoso would you be happy with the rendered html not having any indentation at all?

@dwijnand
Copy link
Member

@gsechaud looks like there's something up with paradox / site on windows.

@gsechaud gsechaud force-pushed the snip-bug-indent branch 6 times, most recently from e697093 to f3585b7 Compare January 27, 2017 13:57
@gsechaud
Copy link
Contributor Author

For comparison:

Before:

minimal-example-usualwriter-html

gave the following unexpected generated page due to the indentation:

minimal-example-usualwriter

With this fix:

minimal-example-noindentwriter-html

gives the following expected result:

minimal-example-noindentwriter

The difference resides in the "generation" of the html pages, not in the creation of the templates/themes. Then no matter how the template is built (with or without indentation), the generated html pages won't include the indentation if there were.

Again here is a comparison for some generated example code before and after to better understand the principle:

generated-usualwriter

generate-noindentwriter

@eed3si9n eed3si9n merged commit d8720db into lightbend:master May 8, 2017
raboof pushed a commit to poWer4aiX/paradox that referenced this pull request Apr 7, 2022
According to the [Java Language Specification](https://docs.oracle.com/javase/specs/jls/se8/html/index.html)
member of packages, e.g. subpackages are identifiers. Identifiers itself is

    ...an unlimited-length sequence of Java letters and Java digits, the first of which must be a Java letter.

As a `Java letter` includes more than what is expressed by the regex `\b[a-z][a-z0-9_]*)\.`, package names which include uppercase or non ASCII characters cannot be processed. I know that there are some _naming conventions_ flying around but something like `aBc.DE.fg` is still a valid package name in my opinion.

I have changed the regex in `packageDotsToSlash()` to `(\b\p{javaJavaIdentifierStart}\p{javaJavaIdentifierPart}*)\.`. Unfortunately this breaks with the changes applied for issue lightbend#397, lightbend#395, lightbend#98, lightbend#86 to handle inner classes. In order to support this notation, the regex can be relaxed to `(\b\p{javaLowerCase}\p{javaJavaIdentifierPart}*)\.`.

I have added the variable 'scaladoc.strictPackageIdent' (which defaults to `false`) by which you can switch between the two regexp. Once set to true, the package name can conform to an identifier now.
raboof pushed a commit to poWer4aiX/paradox that referenced this pull request Apr 7, 2022
According to the [Java Language Specification](https://docs.oracle.com/javase/specs/jls/se8/html/index.html)
member of packages, e.g. subpackages are identifiers. Identifiers itself is

    ...an unlimited-length sequence of Java letters and Java digits, the first of which must be a Java letter.

As a `Java letter` includes more than what is expressed by the regex `\b[a-z][a-z0-9_]*)\.`, package names which include uppercase or non ASCII characters cannot be processed. I know that there are some _naming conventions_ flying around but something like `aBc.DE.fg` is still a valid package name in my opinion.

I have changed the regex in `packageDotsToSlash()` to `(\b\p{javaJavaIdentifierStart}\p{javaJavaIdentifierPart}*)\.`. Unfortunately this breaks with the changes applied for issue lightbend#397, lightbend#395, lightbend#98, lightbend#86 to handle inner classes. In order to support this notation, the regex can be relaxed to `(\b\p{javaLowerCase}\p{javaJavaIdentifierPart}*)\.`.

I have added the variable 'scaladoc.strictPackageIdent' (which defaults to `false`) by which you can switch between the two regexp. Once set to true, the package name can conform to an identifier now.
raboof pushed a commit that referenced this pull request Apr 7, 2022
According to the [Java Language Specification](https://docs.oracle.com/javase/specs/jls/se8/html/index.html)
member of packages, e.g. subpackages are identifiers. Identifiers itself is

    ...an unlimited-length sequence of Java letters and Java digits, the first of which must be a Java letter.

As a `Java letter` includes more than what is expressed by the regex `\b[a-z][a-z0-9_]*)\.`, package names which include uppercase or non ASCII characters cannot be processed. I know that there are some _naming conventions_ flying around but something like `aBc.DE.fg` is still a valid package name in my opinion.

I have changed the regex in `packageDotsToSlash()` to `(\b\p{javaJavaIdentifierStart}\p{javaJavaIdentifierPart}*)\.`. Unfortunately this breaks with the changes applied for issue #397, #395, #98, #86 to handle inner classes. In order to support this notation, the regex can be relaxed to `(\b\p{javaLowerCase}\p{javaJavaIdentifierPart}*)\.`.

I have added the variable 'scaladoc.strictPackageIdent' (which defaults to `false`) by which you can switch between the two regexp. Once set to true, the package name can conform to an identifier now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants