-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b451827
commit f7b7ad3
Showing
9 changed files
with
93 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
...ugin/src/main/kotlin/nl/jolanrensen/docProcessor/defaultProcessors/CommentDocProcessor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package nl.jolanrensen.docProcessor.defaultProcessors | ||
|
||
import nl.jolanrensen.docProcessor.DocumentableWithSource | ||
import nl.jolanrensen.docProcessor.TagDocProcessor | ||
|
||
/** | ||
* @see CommentDocProcessor | ||
*/ | ||
const val COMMENT_DOC_PROCESSOR = "nl.jolanrensen.docProcessor.defaultProcessors.CommentDocProcessor" | ||
|
||
/** | ||
* Adds `{@comment tags}` that will be removed from the docs upon processing. | ||
* | ||
* For example: | ||
* ```kotlin | ||
* /** | ||
* * {@comment This is a comment} | ||
* * This is not a comment | ||
* * @comment This is also a comment | ||
* * and this too | ||
* * @otherTag This is not a comment | ||
* */ | ||
* ``` | ||
* would turn into | ||
* ```kotlin | ||
* /** | ||
* * This is not a comment | ||
* * | ||
* * @otherTag This is not a comment | ||
* */ | ||
* ``` | ||
*/ | ||
class CommentDocProcessor : TagDocProcessor() { | ||
|
||
private val tag = "comment" | ||
override fun tagIsSupported(tag: String): Boolean = | ||
tag == this.tag | ||
|
||
override fun processTagWithContent( | ||
tagWithContent: String, | ||
path: String, | ||
documentable: DocumentableWithSource, | ||
docContent: String, | ||
filteredDocumentables: Map<String, List<DocumentableWithSource>>, | ||
allDocumentables: Map<String, List<DocumentableWithSource>> | ||
): String = "" | ||
|
||
override fun processInnerTagWithContent( | ||
tagWithContent: String, | ||
path: String, | ||
documentable: DocumentableWithSource, | ||
docContent: String, | ||
filteredDocumentables: Map<String, List<DocumentableWithSource>>, | ||
allDocumentables: Map<String, List<DocumentableWithSource>> | ||
): String = "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters