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

Column Selector Grammar in docs #619

Merged
merged 11 commits into from
Jun 10, 2024
Merged

Column Selector Grammar in docs #619

merged 11 commits into from
Jun 10, 2024

Conversation

Jolanrensen
Copy link
Collaborator

@Jolanrensen Jolanrensen commented Mar 12, 2024

Works on #570

Started the process for writing docs for the columns selection DSL. Since the latest doc preprocessor update we are able to @ExportAsHtml any KDoc and this PR aims to export the DSL Grammar from the ColumnsSelectionDSL directly on Writerside.

This makes it dependent on previous KDoc fixes in #613

Aside from those general KDoc fixes, this PR removes some nbsp from type definitions (as those don't align in generated HTML), and it splits the ColumnsSelection DSL grammar in separate interfaces so they can be imported into writerside separately and put in a table (fixed by #618).

@Jolanrensen Jolanrensen added documentation Improvements or additions to documentation (not KDocs) KDocs Improvements or additions to KDocs labels Mar 12, 2024
@Jolanrensen Jolanrensen added this to the 0.13.+ milestone Mar 12, 2024
@Jolanrensen Jolanrensen self-assigned this Mar 12, 2024
@Jolanrensen Jolanrensen marked this pull request as draft March 12, 2024 13:34
@zaleslaw zaleslaw modified the milestones: 0.13.+, 0.14.0 Apr 25, 2024
@zaleslaw
Copy link
Collaborator

@Jolanrensen what is the status of this PR?

@Jolanrensen Jolanrensen changed the title Column Selector docs Column Selector Grammar in docs May 30, 2024
@Jolanrensen Jolanrensen marked this pull request as ready for review May 30, 2024 19:01
@Jolanrensen
Copy link
Collaborator Author

Jolanrensen commented May 30, 2024

It's probably ready to be merged:

image

I've limited this PR to just the inclusion of the grammar in the docs. I'll expand upon the documentation in a new PR :)

@@ -128,7 +128,10 @@ val samplesTest = tasks.register<Test>("samplesTest") {
ignoreFailures = true

testClassesDirs = fileTree("${layout.buildDirectory.get().asFile.path}/classes/testWithOutputs/kotlin")
classpath = files("${layout.buildDirectory.get().asFile.path}/classes/testWithOutputs/kotlin") + configurations["samplesRuntimeClasspath"] + sourceSets["main"].runtimeClasspath
classpath =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add any comment, why classpath consist from these three parts

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure actually, I just reformatted the line because it was too long





Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it fine to have so much blank lines?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the result of @ExcludeFromSources which removes some documentation interfaces. The newlines are originally from in between these interfaces.
When we've updated our linter (#364) I'll turn on the auto-reformat for generated files, so we can fix these cases :)

* You can use @exportAsHtmlStart and @exportAsHtmlEnd to specify a range of the doc to
* export to HTML.
*
* Do not rename!
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make here more stronger; NOTE: DO NOT RENAME!!!!

}
</style>
</head>
<body><p><code><code>columnGroup</code></code></p><p>    <code>| </code><code><strong><code>[</code></strong></code><code><code>column</code></code><strong><code>,</code></strong><code> ..</code><code><strong><code>]</code></strong></code></p><p>    <code>| </code><code><strong><code>[</code></strong></code><strong><code>{ </code></strong><code><code>condition</code></code><strong><code> }</code></strong><code><strong><code>]</code></strong></code></p><p>    <code>| </code><code><strong><code>{</code></strong></code><code> </code><code><code>colsSelector</code></code><code> </code><code><strong><code>}</code></strong></code></p><p>    <code>| </code><strong><code>.</code></strong><code><strong><code>allCols</code></strong></code><strong><code>()</code></strong></p><p>    <code>| </code><strong><code>.allCols</code></strong><code>(</code><code><strong><code>Before</code></strong></code><code>|</code><code><strong><code>After</code></strong></code><code>|</code><code><strong><code>From</code></strong></code><code>|</code><code><strong><code>UpTo</code></strong></code><code>) ( </code><strong><code>(</code></strong><code><code>column</code></code><strong><code>)</code></strong><code> | </code><strong><code>{ </code></strong><code><code>colSelector</code></code><strong><code> }</code></strong><code> )</code></p><p>    <code>| </code><strong><code>.</code></strong><code><strong><code>allColsExcept</code></strong></code><strong><code> { </code></strong><code><code>colsSelector</code></code><strong><code> } </code></strong></p><p>    <code>| </code><strong><code>.</code></strong><code><strong><code>allColsExcept</code></strong></code><strong><code>(</code></strong><code><code>columnNoAccessor</code></code><strong><code>,</code></strong><code> ..</code><strong><code>)</code></strong></p><p>    <code>| </code><strong><code>.</code></strong><code><strong><code>and</code></strong></code><strong><code> (</code></strong><code>|</code><strong><code>{ </code></strong><code><code>columnOrSet</code></code><strong><code> }</code></strong><code>|</code><strong><code>)</code></strong></p><p>    <code>| (</code><strong><code>.</code></strong><code><strong><code>col</code></strong></code><code>| </code><strong><code>.</code></strong><code><strong><code>valueCol</code></strong></code><code>| </code><strong><code>.</code></strong><code><strong><code>frameCol</code></strong></code><code>| </code><strong><code>.</code></strong><code><strong><code>colGroup</code></strong></code><code>)[</code><strong><code>&lt;</code></strong><code><code>T</code></code><strong><code>&gt;</code></strong><code>]</code><strong><code>(</code></strong><code><code>column</code></code><code> | </code><code><code>index</code></code><strong><code>)</code></strong></p><p>    <code>| (</code><strong><code>.</code></strong><code><strong><code>cols</code></strong></code><code>| </code><strong><code>.</code></strong><code><strong><code>valueCols</code></strong></code><code>| </code><strong><code>.</code></strong><code><strong><code>frameCols</code></strong></code><code>| </code><strong><code>.</code></strong><code><strong><code>colGroups</code></strong></code><code>) [ </code><strong><code>{ </code></strong><code><code>condition</code></code><strong><code> }</code></strong><code> ]</code></p><p>    <code>| </code><strong><code>.</code></strong><code><strong><code>cols</code></strong></code><code>[</code><strong><code>&lt;</code></strong><code><code>T</code></code><strong><code>&gt;</code></strong><code>]</code><strong><code>(</code></strong><code><code>column</code></code><strong><code>,</code></strong><code>.. |</code><code><code>index</code></code><strong><code>,</code></strong><code>.. |</code><code><code>indexRange</code></code><strong><code>)</code></strong></p><p>    <code>| </code><strong><code>.</code></strong><code><strong><code>colsAtAnyDepth</code></strong></code><code> [ </code><strong><code>{ </code></strong><code><code>condition</code></code><strong><code> }</code></strong><code> ]</code></p><p>    <code>| </code><strong><code>.</code></strong><code><strong><code>colsInGroups</code></strong></code><code> [ </code><strong><code>{ </code></strong><code><code>condition</code></code><strong><code> }</code></strong><code> ]</code></p><p>    <code>| </code><strong><code>.colsName</code></strong><code>(</code><code><strong><code>Starts</code></strong></code><code>|</code><code><strong><code>Ends</code></strong></code><code>)</code><strong><code>With</code></strong><strong><code>(</code></strong><code><code>text</code></code><code>[</code><strong><code>, </code></strong><code><code>ignoreCase</code></code><code>]</code><strong><code>)</code></strong></p><p>    <code>| </code><strong><code>.</code></strong><code><strong><code>colsNameContains</code></strong></code><strong><code>(</code></strong><code><code>text</code></code><code>[</code><strong><code>, </code></strong><code><code>ignoreCase</code></code><code>] | </code><code><code>regex</code></code><strong><code>)</code></strong></p><p>    <code>| </code><strong><code>.</code></strong><code><strong><code>colsOfKind</code></strong></code><strong><code>(</code></strong><code><code>kind</code></code><strong><code>,</code></strong><code> ..</code><strong><code>)</code></strong><code> [ </code><strong><code>{ </code></strong><code><code>condition</code></code><strong><code> }</code></strong><code> ]</code></p><p>    <code>| </code><strong><code>.</code></strong><code><strong><code>colsWithoutNulls</code></strong></code><strong><code>()</code></strong></p><p>    <code>| </code><strong><code>.</code></strong><code><strong><code>drop</code></strong></code><code>(</code><code><strong><code>Last</code></strong></code><code>)</code><code><strong><code>Cols</code></strong></code><strong><code>(</code></strong><code><code>number</code></code><strong><code>)</code></strong></p><p>    <code>| </code><strong><code>.</code></strong><code><strong><code>drop</code></strong></code><code>(</code><code><strong><code>Last</code></strong></code><code>)</code><code><strong><code>ColsWhile</code></strong></code><strong><code> { </code></strong><code><code>condition</code></code><strong><code> }</code></strong></p><p>    <code>| </code><code><strong><code>exceptNew</code></strong></code><strong><code> { </code></strong><code><code>colsSelector</code></code><strong><code> } EXPERIMENTAL!</code></strong></p><p>    <code>| </code><code><strong><code>exceptNew</code></strong></code><strong><code>(</code></strong><code><code>columnNoAccessor</code></code><strong><code>,</code></strong><code> ..</code><strong><code>) EXPERIMENTAL!</code></strong></p><p>    <code>| (</code><strong><code>.</code></strong><code><strong><code>firstCol</code></strong></code><code>| </code><strong><code>.</code></strong><code><strong><code>lastCol</code></strong></code><code>| </code><strong><code>.</code></strong><code><strong><code>singleCol</code></strong></code><code>) [ </code><strong><code>{ </code></strong><code><code>condition</code></code><strong><code> }</code></strong><code> ]</code></p><p>    <code>| </code><strong><code>.</code></strong><code><strong><code>select</code></strong></code><strong><code> { </code></strong><code><code>colsSelector</code></code><strong><code> }</code></strong></p><p>    <code>| </code><strong><code>.</code></strong><code><strong><code>take</code></strong></code><code>(</code><code><strong><code>Last</code></strong></code><code>)</code><code><strong><code>Cols</code></strong></code><strong><code>(</code></strong><code><code>number</code></code><strong><code>)</code></strong></p><p>    <code>| </code><strong><code>.</code></strong><code><strong><code>take</code></strong></code><code>(</code><code><strong><code>Last</code></strong></code><code>)</code><code><strong><code>ColsWhile</code></strong></code><strong><code> { </code></strong><code><code>condition</code></code><strong><code> }</code></strong></p><p>    </p><p><code><code>singleColumn</code></code></p><p>    <strong><code>.</code></strong><code><strong><code>colsOf</code></strong></code><strong><code>&lt;</code></strong><code><code>T</code></code><strong><code>&gt;</code></strong><code> [ </code><strong><code>(</code></strong><code><code>kType</code></code><strong><code>)</code></strong><code> ] [ </code><strong><code>{ </code></strong><code><code>condition</code></code><strong><code> }</code></strong><code> ]</code></p><p>    </p><p><code><code>columnGroupReference</code></code></p><p>    <strong><code>.</code></strong><code><strong><code>colsOf</code></strong></code><strong><code>&lt;</code></strong><code><code>T</code></code><strong><code>&gt;(</code></strong><code><code>kType</code></code><strong><code>)</code></strong><code> [ </code><strong><code>{ </code></strong><code><code>condition</code></code><strong><code> }</code></strong><code> ]</code></p></body>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How it was generated? If I need somehow to change it in the future, how I could do this? Is it a result of preprocessor work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, all we need is the @ExportAsHtml annotation on a KDoc-holding element and the preprocessor will generate a file like this in the snippets folder :).

If you change something in the KDoc of that interface and run the preprocessor like normal, the html file will be updated as well automatically.

Like:

@Jolanrensen Jolanrensen merged commit aa24b45 into master Jun 10, 2024
2 of 3 checks passed
@Jolanrensen Jolanrensen deleted the column-selector-docs branch June 10, 2024 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation (not KDocs) KDocs Improvements or additions to KDocs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants