Comments (8)
no
from custom-elements-manifest.
yeah sounds like a good feature, please open a pr
from custom-elements-manifest.
Currently to-markdown
doesnt support this, no. It is something we've considered adding before, but we havent got there yet.
What you can do is create a custom plugin, modify/filter the customElementsManifest
object to filter out what you want/dont want, and then pass it to customElementsManifestToMarkdown
. e.g.:
import { customElementsManifestToMarkdown } from '@custom-elements-manifest/to-markdown';
export function markdown() {
return {
name: 'markdown',
packageLinkPhase({customElementsManifest}) {
// mutate the cem
customElementsManifest?.modules?.forEach(mod => {
mod.declarations = mod?.declarations?.filter(({kind}) => kind === 'class');
});
// pass it to markdown
const md = customElementsManifestToMarkdown(customElementsManifest);
// write to file somehow
}
}
}
I would be down to help if i can, but i'm not that familiar with ASTs and such.
I do agree that the functional approach and all the AST-y stuff isn't really inviting or welcoming for contributions, which is a bit of a shame..
from custom-elements-manifest.
I started working on a PR, relevant code starts here:
https://github.com/michaelwarren1106/custom-elements-manifest/blob/master/packages/to-markdown/index.js#L109
but your comment about the plugin makes me think that I might need to change approach a bit? would you prefer I open a WIP PR for feedback, or are my local repo changes good enough for you to get an idea of where i am headed?
I went down the road of having a config object that has booleans for each section/type of info that can be removed, so that, when false
the section isnt rendered. The only struggle Im having right now is telling the difference between the "main class" and super classes, because currently the manifest schema doesnt seem to mark them differently. I have an option currently to remove superClass
sections in case those aren't relevant for whatever reason, but the way the nodes get rendered leaves me a bit confused on the best way to check to see if the node i'm about to render belongs to a super class, since i only have kind === 'class'
and the superClass
property.
from custom-elements-manifest.
PR is also fine, in that case i'll defer to @bennypowers
from custom-elements-manifest.
question: in the manifest.json will the last kind === 'class'
declaration always be the "root class"?
from custom-elements-manifest.
will do! i started down one path but i think i have a better idea, so i’m gonna start over.
was struggling with how to remove superclasses but i think i have a config approach that’ll be flexible enough to allow all kinds of final documentation use cases
from custom-elements-manifest.
from custom-elements-manifest.
Related Issues (20)
- CEM Analyze fails when using `@link` in a `@param` tsdoc statement HOT 2
- CEM fails with `@link` `@attr` and `@internal` HOT 4
- getDefaultValuesFromConstructorVisitor make incorrect fields in class members
- update included typescript version HOT 3
- Resolve `@typedef` imports from local and/or external files HOT 2
- Fails to get dependency information if using an import alias HOT 2
- analyzer doesn't collect all jsdoc
- Add option to choose line endings within strings in custom-elements.json
- Analyzing override jsdoc tag HOT 1
- [Analyzer]: Not collect the component data if `Static initialization blocks` are used.
- Can't parse the name of a custom element name if the name is read from a variable
- command fails with "Unexpected token '.'" HOT 2
- HOWTO pass custom cli arguments to `analyze` that a plugin can work on? HOT 1
- [Analyzer]: Module resolution issue with dependencies and TypeScript HOT 1
- `dependencies` Option Doesn't Work on Windows
- Option to create own context HOT 4
- Programmatic JS API instead of CLI, How-to? HOT 1
- Analyzer error when extending a mixin with a typescript type param HOT 4
- Methods using `#` Access Modifier is Not Marked as `private` HOT 1
- Object value assignments are not getting set as default
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from custom-elements-manifest.