Comments (13)
Not sure if this is related to this issue or not, let me know if you prefer that I open a different issue, but I found a return value that is also duplicated in one of those files:
The following is the code if it helps:
/**
* Adds the popup to a map.
*
* @param map - The MapLibre GL JS map to add the popup to.
* @returns `this`
* @example
* ```ts
* new Popup()
* .setLngLat([0, 0])
* .setHTML("<h1>Null Island</h1>")
* .addTo(map);
* ```
* @see [Display a popup](https://maplibre.org/maplibre-gl-js/docs/examples/popup/)
* @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/popup-on-hover/)
* @see [Display a popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/popup-on-click/)
* @see [Show polygon information on click](https://maplibre.org/maplibre-gl-js/docs/examples/polygon-popup-on-click/)
*/
addTo(map: Map): this {
if (this._map) this.remove();
this._map = map;
from typedoc-plugin-markdown.
Actually, I now see the issue with the duplicate return type in the existing docs which uses an older version, so this apparently is not a new bug.
The duplicate file is a new bug though.
from typedoc-plugin-markdown.
@HarelM Thank you for the detailed description.
The duplicate return type i think is something else (its also happening on the HTML theme) and i'll look at that next.
Here are my findings on the duplicate Class files.
Issue
The root cause of the duplicate file appears to be a misuse of the @event tag
on the Marker Class.
![Screenshot 2024-05-03 at 22 52 23](https://private-user-images.githubusercontent.com/11680870/327889487-e46c77ea-741d-46c8-b146-e506ab08777a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3NjM5NTEsIm5iZiI6MTcyMzc2MzY1MSwicGF0aCI6Ii8xMTY4MDg3MC8zMjc4ODk0ODctZTQ2Yzc3ZWEtNzQxZC00NmM4LWIxNDYtZTUwNmFiMDg3NzdhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDIzMTQxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg0YTU5NWQwNzhhNWZkMDNkNDhjNzYwOGVkMzY4ZjA4ZWIwZWJmMWVmNzAyODIyNGFkNjU3ZDA3MzI5MWVjZDkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.46JR4hTGSVxm6ReTAaVxShDxqieqBf5lxT4NBcCBxoo)
What this appears to be doing is marking the Marker Class itself as an Event, which TypeDoc is then duplicating in an Events group.
Here is a screenshot (its using the HTML theme as it is easier for me to demonstrate):
![Screenshot 2024-05-03 at 22 51 30](https://private-user-images.githubusercontent.com/11680870/327889779-e806a97a-4056-43c2-814b-3b6054b31cee.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3NjM5NTEsIm5iZiI6MTcyMzc2MzY1MSwicGF0aCI6Ii8xMTY4MDg3MC8zMjc4ODk3NzktZTgwNmE5N2EtNDA1Ni00M2MyLTgxNGItM2I2MDU0YjMxY2VlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDIzMTQxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM2Y2Q5ZDhmYTc4Njg4NDM1NTM3YTkzYzJmNWM3NmU4Zjk1MTdhMzQ5MWFiNjk2ZWJmYWQxZjNkMjZjYmM4NmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.q4QO_jryLaQlgIDNVPrnxOQR256o3Ie2ZEitIOb1chA)
Fix
If you remove the @event
tags then Marker is no longer duplicated into the Events group and the file is not duplicated.
![Screenshot 2024-05-03 at 22 53 55](https://private-user-images.githubusercontent.com/11680870/327890482-b8197ca5-ea9b-4b27-8b8d-c41f6ff09fdf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3NjM5NTEsIm5iZiI6MTcyMzc2MzY1MSwicGF0aCI6Ii8xMTY4MDg3MC8zMjc4OTA0ODItYjgxOTdjYTUtZWE5Yi00YjI3LThiOGQtYzQxZjZmZjA5ZmRmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDIzMTQxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ0NjJmNjlhZGMyMmUyMGVkYWVmOTJhOTFjMzFjNzAwMDZmZTE5MTY3YTIwOGVmMzhiNTRjMjVhMWNjNTI2ZDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.1NDDha9odf00T0AE9cRjTavTIKvAB4-5aOhLRkYxIHc)
![Screenshot 2024-05-03 at 22 53 45](https://private-user-images.githubusercontent.com/11680870/327890526-60ae85e1-eefb-4941-af83-c72013533360.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3NjM5NTEsIm5iZiI6MTcyMzc2MzY1MSwicGF0aCI6Ii8xMTY4MDg3MC8zMjc4OTA1MjYtNjBhZTg1ZTEtZWVmYi00OTQxLWFmODMtYzcyMDEzNTMzMzYwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDIzMTQxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdiMjgwNDlkN2Y2ZjFjNjg5ZTY0MzA4OTQ5ZGZjODZkOGFhYWMzYTlkZDNhNWRkOGJiN2VlODg1ZTBkNjcwMjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.0UJfRVoHjwiwLbOwgBvLfKGk-hWk9O4dqOaOkp_0XhU)
The issue was hidden previously because the duplicate file was saving on top of the original.
from typedoc-plugin-markdown.
So the duplicate returns is also a comment issue. The @returns
tag is not required here as the type is inferred. What is happening is that this
is being printed as the return type description:
![Screenshot 2024-05-03 at 23 30 18](https://private-user-images.githubusercontent.com/11680870/327894260-923cef10-44a5-42ab-a411-8792d1a6c0be.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3NjM5NTEsIm5iZiI6MTcyMzc2MzY1MSwicGF0aCI6Ii8xMTY4MDg3MC8zMjc4OTQyNjAtOTIzY2VmMTAtNDRhNS00MmFiLWE0MTEtODc5MmQxYTZjMGJlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDIzMTQxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE1MWE5NDY4OTk3ZjVkNTQzYjFlYzA2ZjJjMWM0MDNlNDVmZjI5YjAxMmM5MTg4YWI5OWU0Yzg2MzU1ZDQ5YTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.dJop4tl24H_kqW-eEe1xpN-Fe1eGCVIgzZ9pZTXVaXE)
from typedoc-plugin-markdown.
Thanks for the detailed responses!
Should I move this issue to the typedoc repo?
How should I document a class that raises events if not with the @event
tag?
Also there are other return type that are inferred, is this issue relevant only for "this"?
Or is this because the description for the return is "this" and I should write something better like "this - for chaining" it something?
Thanks again for the prompt response!
from typedoc-plugin-markdown.
Should I move this issue to the typedoc repo?
I don't think it is a bug because the @event
tag needs to be used on the reflection that is being marked as the event. The interpretation of the tag is pretty basic at the moment in the sense that it simply groups the marked reflection in an 'Events' group. Arguably it should probably be ignored in this scenario though.
How should I document a class that raises events if not with the
@event
tag?
I think something like this (not tested) - you could create static properties on the Marker class.
![Screenshot 2024-05-04 at 10 25 12](https://private-user-images.githubusercontent.com/11680870/327938298-5920ac58-a1c0-42c2-9ad6-887dfde2cf53.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3NjM5NTEsIm5iZiI6MTcyMzc2MzY1MSwicGF0aCI6Ii8xMTY4MDg3MC8zMjc5MzgyOTgtNTkyMGFjNTgtYTFjMC00MmMyLTlhZDYtODg3ZGZkZTJjZjUzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDIzMTQxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNiMmFkNzdlNzhjNzc4YmIyOTljODdjNjE1NmNjMTJlYjc0NjI0OGQ3ZTMyZTVlNzhiYzE3NDk1ZDE4NDU0ZTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.3sGlQd6zu-BbZYAauxpm9ICOBqCcVEdiggNIch-MuRk)
![Screenshot 2024-05-04 at 10 25 28](https://private-user-images.githubusercontent.com/11680870/327938304-576566da-1953-49f0-a243-c7f87667a0cf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3NjM5NTEsIm5iZiI6MTcyMzc2MzY1MSwicGF0aCI6Ii8xMTY4MDg3MC8zMjc5MzgzMDQtNTc2NTY2ZGEtMTk1My00OWYwLWEyNDMtYzdmODc2NjdhMGNmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDIzMTQxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBmYzQzMDk2NjFhYjg2MzI4MTczZDllNDRhYjcxMzQ4ZDhlNGEzZmU0YTQ3YjY0YTg5MzM4NGNmODZmMGJkOGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.rxwv_51I_X49br_dm53j1mLBfkeorKkIrfNPacH7Ogs)
You could even encourage use of the static property by consumers:
![Screenshot 2024-05-04 at 10 27 28](https://private-user-images.githubusercontent.com/11680870/327938404-3662775b-3351-4d93-921a-6fcde728ff86.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3NjM5NTEsIm5iZiI6MTcyMzc2MzY1MSwicGF0aCI6Ii8xMTY4MDg3MC8zMjc5Mzg0MDQtMzY2Mjc3NWItMzM1MS00ZDkzLTkyMWEtNmZjZGU3MjhmZjg2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDIzMTQxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQwMGM4YzVmMmVhZjJiMmZiZjgxN2U1NjQ4NTIwYjRiNzJiMTMyODAxM2YxOGIwYzEzODZjOGVlYzNhYzRmMmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.WSE9p2nPfspl3I5CXqVdZN2GdehNQcMvbQoKLU2ULEM)
This will correctly assign the events as grouped within the Marker class as follows (using HTML theme):
![Screenshot 2024-05-04 at 10 42 10](https://private-user-images.githubusercontent.com/11680870/327939109-122889d8-a324-42bf-ac8c-ca560b0997c9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3NjM5NTEsIm5iZiI6MTcyMzc2MzY1MSwicGF0aCI6Ii8xMTY4MDg3MC8zMjc5MzkxMDktMTIyODg5ZDgtYTMyNC00MmJmLWFjOGMtY2E1NjBiMDk5N2M5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDIzMTQxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNmMjgxNDU5YzI4MGM3NGMwMjQxN2U1NDMxNWVmNjE1NGJhYTk4MTg5ODU1M2RkYWZlMzVmZTQxMGQ2MzE2MmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.WE30JF88gzx5iSMhK0f2jlfjTLApDQ1hdJjaLJoSj18)
If you don't want to do this then i think you would simply not use the @event
tag as per my first example.
Also there are other return type that are inferred, is this issue relevant only for "this"?
Or is this because the description for the return is "this" and I should write something better like "this - for chaining" it something?
No all types will be inferred from code and you only need to write a return description in the @return
tag. Something like this:
![Screenshot 2024-05-04 at 09 34 23](https://private-user-images.githubusercontent.com/11680870/327935830-16747e2e-32ca-4c29-92db-7d538a81da40.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3NjM5NTEsIm5iZiI6MTcyMzc2MzY1MSwicGF0aCI6Ii8xMTY4MDg3MC8zMjc5MzU4MzAtMTY3NDdlMmUtMzJjYS00YzI5LTkyZGItN2Q1MzhhODFkYTQwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDIzMTQxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYzODkwNDUyOTBmNWMxMDRiYjI4ZjYxODQzYzQxMTc5YjYxNWNhNjIzNTQ5ODMzOTAzZTZhM2M2MWExZTZiYTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.iMcRCNXu_Sb-j9hh4gPd0L65siftpjW0B6rlb7R6rA4)
![Screenshot 2024-05-04 at 09 36 53](https://private-user-images.githubusercontent.com/11680870/327935883-6e9c0479-8e37-448f-9270-7b49b23400f2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3NjM5NTEsIm5iZiI6MTcyMzc2MzY1MSwicGF0aCI6Ii8xMTY4MDg3MC8zMjc5MzU4ODMtNmU5YzA0NzktOGUzNy00NDhmLTkyNzAtN2I0OWIyMzQwMGYyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDIzMTQxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUzZjE3NjMzOTFmNGM3NTA5MjY2MzJjY2Y5Yzc4ZjRlODdiNjU2NDJhMjUxMDlkNDI3Yjc1ZWVjZjA5MTYzMzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Q6SSteMqyHJ9vnX5JjCxFe8nfEfQWcY_e_0quUydw6E)
from typedoc-plugin-markdown.
I see. Thanks a lot for all the suggestions!
Feel free to close this issue.
from typedoc-plugin-markdown.
No probs at all! If you find anything else please do raise another issue. Closing this one.
from typedoc-plugin-markdown.
Thanks! I made the following PR to resolve all the issues:
maplibre/maplibre-gl-js#4075
As a side note, I couldn't find the "Example" text in the strings that one can replace in the options, it is intentional?
https://typedoc-plugin-markdown.org/docs/options#textcontentmappings
Also the previous version set the example title with code style and not as a header.
When I have two examples one after the other it creates this not-so-great table of content when using mkdocs:
See the right side table of content where it has example twice:
Is there a way for me to improve that?
from typedoc-plugin-markdown.
As a side note, I couldn't find the "Example" text in the strings that one can replace in the options, it is intentional?
No - that was overlooked as it is generated from a tag - this can be added though. As an FYI I am not sure if the upcoming localization support will affect the recommended implementation for updating text string. https://github.com/TypeStrong/typedoc/blob/beta/internal-docs/internationalization.md.
Also the previous version set the example title with code style and not as a header.
When I have two examples one after the other it creates this not-so-great table of content when using mkdocs:
Because the examples are already in code blocks you don't actually need to use the @example
tag. You could just write @example1
and @example2
.
However if you don't want the tags to be headers at all (and not in the toc) maybe we can introduce an option. Something like commentTagStyle
: "heading"
| "code"
which would default to "heading"
but can be set to "code"
for same behaviour as v3. Let me know if you think that sounds useful?
from typedoc-plugin-markdown.
I'm not sure I want to use "custom" tsdoc tags such as "example1" as I would like to have the docs pass some linting, which might look for unknown tags.
Also the IDE presents these comments, so I do want to keep it as standard as possible.
For me, it would be great if the examples would be grouped together under a "Examples" header in case of multiple examples in the same comment and "Example in case of a single comment.
I'm not sure how possible this is using this plugin, but I think it will achieve the best user experience.
Another option is to keep the same level of header for the method example (currently ####
) as the class example (currently ##
), this will keep things looking the same.
You can see the different values in the following output of marker.ts class here:
Class:
# Marker
Creates a marker component
## Example
```ts
let marker = new Marker()
.setLngLat([30.5, 50.5])
.addTo(map);
``
## Example
Set options
``ts
let marker = new Marker({
color: "#FFFFFF",
draggable: true
}).setLngLat([30.5, 50.5])
.addTo(map);
``
## See
- [Add custom icons with Markers](https://maplibre.org/maplibre-gl-js/docs/examples/custom-marker-icons/)
- [Create a draggable Marker](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-marker/)
## Events
**Event** `dragstart` of type [Event](Event.md) will be fired when dragging starts.
**Event** `drag` of type [Event](Event.md) will be fired while dragging.
**Event** `dragend` of type [Event](Event.md) will be fired when the marker is finished being dragged.
## Extends
- [`Evented`](Evented.md)
Method:
## Methods
### addClassName()
> **addClassName**(`className`: `string`): `void`
Adds a CSS class to the marker element.
#### Parameters
| Parameter | Type | Description |
| :------ | :------ | :------ |
| `className` | `string` | on-empty string with CSS class name to add to marker element |
#### Returns
`void`
#### Example
``
let marker = new Marker()
marker.addClassName('some-class')
``
#### Source
[src/ui/marker.ts:641](https://github.com/maplibre/maplibre-gl-js/blob/96781701ea7763b2ef6a0d26526463fbfad020e2/src/ui/marker.ts#L641)
***
from typedoc-plugin-markdown.
For me, it would be great if the examples would be grouped together under a "Examples" header in case of multiple examples in the same comment and "Example in case of a single comment.
Thats not a bad idea. We could achieve the following with multiple @example
tags:
![Screenshot 2024-05-06 at 13 11 29](https://private-user-images.githubusercontent.com/11680870/328172973-ecf6bff2-9f6e-466e-8c31-abe3379bd29c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3NjM5NTEsIm5iZiI6MTcyMzc2MzY1MSwicGF0aCI6Ii8xMTY4MDg3MC8zMjgxNzI5NzMtZWNmNmJmZjItOWY2ZS00NjZlLThjMzEtYWJlMzM3OWJkMjljLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDIzMTQxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNjNjk0M2U1Zjc5NDc0YjU2ODMyZWNmOWQyMGY5OGQ4OGExMWY5YWU3ZjlkYzhiYTEzN2MyM2JkYjIwZmQwMGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.wW1c48JhG4PWL_V5axcafK8qAF5xVt8vGXhtkmQ9_vc)
![Screenshot 2024-05-06 at 13 11 21](https://private-user-images.githubusercontent.com/11680870/328172989-6288976a-7339-4394-9604-eb630728795e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM3NjM5NTEsIm5iZiI6MTcyMzc2MzY1MSwicGF0aCI6Ii8xMTY4MDg3MC8zMjgxNzI5ODktNjI4ODk3NmEtNzMzOS00Mzk0LTk2MDQtZWI2MzA3Mjg3OTVlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE1VDIzMTQxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNkNWYyYTE1ZjJlNjRlMTIxODc5MjQyNDQwNTRmNzU4MWVjNmU4NTRjYmU4MjMyY2I2NTIxMTBhODAxNGQyNDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.gPEApB4_vkjR7Ys1sLyhk3d_AgdFy_HePJp1KG5Hc1U)
from typedoc-plugin-markdown.
Looks good!
from typedoc-plugin-markdown.
Related Issues (20)
- Add option to generate relative links with forward slashes in typedoc-plugin-markdown HOT 2
- Error: The docs folder does not exist when the `out` folder does not exists HOT 2
- vitepress example broken when cloned locally HOT 6
- v4.1 removes relative link HOT 2
- id in typedoc-sidebar.cjs incorrectly calculated HOT 2
- githubPages option does not generate .nojekyll file HOT 3
- TypeDoc exiting with unexpected error: Error: Debug Failure. False expression. HOT 2
- flattenOutputFiles is true, but the name structure should be text-text-text-text.md HOT 2
- Intra-page hash links to sections are incompatible with Docusaurus 3.4 HOT 3
- Examples block not being rendered HOT 4
- Sidebar 'typedoc-sidebar.cjs' is generated with backward slashes instead of forward slashes HOT 3
- @category doc over class props, causes constructor to be categorized as "Other" HOT 3
- navigation is missing nested entrypoints HOT 2
- bug: descriptions are being dropped for "other" category symbols HOT 4
- Angle brackets for generics are unnecessarily escaped in Docusaurus sidebar HOT 1
- Add a `outputFileStrategy` for categories HOT 1
- Fails to merge when entryPoints is a file array HOT 2
- Method description not shown when methods use arrows HOT 3
- htmlTable is missing thead and tbody HOT 1
- Support table and htmlTable for return value HOT 1
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 typedoc-plugin-markdown.