-
Notifications
You must be signed in to change notification settings - Fork 63
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
KDocs start using Doc Preprocessor Gradle plugin #214
Conversation
The only problem atm is in usability. Due to the lack of multiline strings, we need to do: import org.jetbrains.kotlinx.dataframe.DataFrame
import org.jetbrains.kotlinx.dataframe.exceptions.DuplicateColumnNamesException
import org.jetbrains.kotlinx.dataframe.exceptions.UnequalColumnSizesException
/** either
//#local ADD = evalFile("add.txt")
*/
/** or
//#local ADD0 = " * Original [DataFrame] is not modified."
//#local ADD1 = " *"
//#local ADD2 = " * @throws [DuplicateColumnNamesException] if columns in expected result have repeated names"
//#local ADD3 = " * @throws [UnequalColumnSizesException] if columns in expected result have different sizes"
//#local ADD4 = " * @return new [DataFrame] with added columns"
//
//#local ADD = ADD0 + "\n" + ADD1 + "\n" + ADD2 + "\n" + ADD3 + "\n" + ADD4
*/
/**
* Creates new [DataFrame] with given columns added to the end of original [DataFrame.columns] list.
*
/*$ADD$*/
* @param columns columns to add
*/
public fun <T> DataFrame<T>.add(vararg columns: AnyBaseCol): DataFrame<T> = addAll(columns.asIterable()) |
Using my self-built gradle plugin is probably a better solution https://github.com/Jolanrensen/kdocIncludeGradlePlugin |
https://github.com/Jolanrensen/docProcessorGradlePlugin/tree/main was updated to allow other processors as well. Maybe |
Continuing with KDoc example structure
… other where-occurrences
# Conflicts: # core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/update.kt
What is the future of this PR? |
Will rebase on master, fix every conflict and then ask for a review :) |
# Conflicts: # core/build.gradle.kts # core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/aliases.kt # core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnsSelectionDsl.kt # core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/Nulls.kt # core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/add.kt # core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/gather.kt # core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/reorder.kt # core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/select.kt # core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/toDataFrame.kt # core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/update.kt # core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/convertTo.kt # core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/gather.kt # core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/reorder.kt # core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/update.kt # core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/constructors.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file I just started with, will probably work on docs after this PR is merged in a separate branch
ready for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not so many issues in reality, I will try to summarize them
- be accurate with inserted code and probably wrap with the kotlin code insertion
- convert some todos into issues or fix them
- answer some questions
- if possible, extract abstraction required for documentation building to the separate places
Some notes for the future:
- Did we have a chance to use constants instead of interfaces?
- Could we use @see tag instead of direct links with pattern?
- Could we reuse the same snipppets of code used in the documentation to insert them and checking compiling it once
core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/constructors.kt
Show resolved
Hide resolved
core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/samples/ApiLevels.kt
Outdated
Show resolved
Hide resolved
core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/samples/ApiLevels.kt
Outdated
Show resolved
Hide resolved
...generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/ColumnsSelectionDsl.kt
Outdated
Show resolved
Hide resolved
...sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/ExpressionsGivenRow.kt
Show resolved
Hide resolved
...sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/ExpressionsGivenRow.kt
Outdated
Show resolved
Hide resolved
...sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/ExpressionsGivenRow.kt
Show resolved
Hide resolved
...ed-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/SelectingColumns.kt
Show resolved
Hide resolved
...d-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/documentation/DocumentationUrls.kt
Show resolved
Hide resolved
I cannot wrap code samples with triple backticks because then links inside won't be clickable anymore. If that was what you meant with
|
Probably, I'll try to do it in my PR with docs and we could compare two approaches |
The final version of this PR consists of:
ColumnExpression
alias and use of it across the API instead of a specificSelector
.:core
documentation
packageThe rendered version of the docs can be found at
:core/generated-sources
and it would probably be useful to review those as well as the source files. I'm curious to hear about how you find the resulting docs and whether the structure I provided for the two API files (and the common docs) is repeatable for the rest of the API or if you have some additions, concerns etc.Old message: