dart-lang / dartdoc

API documentation tool for Dart.
https://pub.dev/packages/dartdoc
BSD 3-Clause "New" or "Revised" License
473 stars 119 forks source link

[Feature Request] Add some distinguishable info to the file name #3388

Open literalEval opened 1 year ago

literalEval commented 1 year ago

General Info

We are an Open Source organization, using Dart Doc to document our codebase :) The overall org's documentation is built using Docusaurus and is hosted on GitHub Pages.

The Problem

Dart Doc seems to generate files with the same name. So say there is a class named Message, which has an attribute named message, then their respective HTML files will be Message.html and message.html. This is causing issues with the deployment, as it says that Files with same name but different case can't be used. Refer this deploy action fail to see the exact issue.

Possible Solution

If there already exists any way to generate files with distinguishable names, please let me know. Otherwise, it would be good to configure Dart Doc to produce files with different names. This can be achieved by adding files hash to their name itself. Or a numbering before their name?

jcollins-g commented 1 year ago

Dartdoc already has some filename collision management logic for edge cases but I don't think it is case-insensitive. Adding to that or having a collision-proof naming scheme both could work. A collision proof naming scheme will break package cross-linking during rollout if not controlled by a dartdoc option so perhaps an implementation could use a dartdoc_options.yaml option.

literalEval commented 1 year ago

@jcollins-g glad you considered this an enhancement. I will be more than happy if I could help in it's development :)

palisadoes commented 1 year ago

The important message in the error we see with the Docusaurus deployment is:

This means that in our situation, Docusaurus is trying to protect itself from files with the same name but different capitalizations being overwritten on Windows filesystems, thereby breaking the markdown to HTML conversion process.