MaxMelcher / AzureDevOps.WikiPDFExport

Export Azure DevOps Wiki to PDF
MIT License
187 stars 62 forks source link

Not all wikis have .order files #31

Closed howardjones closed 3 years ago

howardjones commented 3 years ago

I thought I'd try this on our Project wiki, only to get a blank document! Two observations: 1) verbose mode isn't very verbose (e.g. would be good if it told you what/how many files it had processed) 2) our wiki doesn't have any .order files, so the exporter doesn't do anything

I'm going to try and write a replacement/fallback for ReadOrderFiles that just walks the directories.

MaxMelcher commented 3 years ago
  1. It does that once there are pages. Happy to merge suggestions for better verbosity.
  2. how is the order of the pages then determined? Random? Alphabetically?
howardjones commented 3 years ago
Log($"Converting Markdown to HTML for {files.Count} files");

Meant I could at least tell if it thought it was working.

As far as I can see, alphabetically. And actually a few sub-directories do have a .order file, but it doesn't include all the pages, and the index in the wiki itself shows all the pages, so it's unclear what the .order file is actually doing. I think those files first, and then alphabetical, which might explain an issue I had with sorting in the wiki, now I think about it :-) I think it depends on whether you add pages directly to the git repo, or via the wiki UI.

I did get a simple file search working last night. It doesn't do the ordering as described above though, yet.

howardjones commented 3 years ago

Hmmm, well I have a version that I can run build in VSCode that does what I want (convert all .md files found, in alphabetical order), but only by shipping around 176 files... trying to publish with -p:PublishSingleFile=true -p:PublishTrimmed=true crashes with "Found multiple entries with the same BundleRelativePath". I don't know what a BundleRelativePath is, or where that might come from. I don't see anything duplicated in the .csproj file.

The contents tree of the PDF is a bit strange too - lots, but not all, of the internal headers, in a funny order. Will probably investigate further there.

chucker commented 3 years ago

how is the order of the pages then determined? Random? Alphabetically?

FWIW:

https://docs.microsoft.com/en-us/azure/devops/project/wiki/wiki-file-structure?view=azure-devops

When there's no .order file the pages are sorted alphabetically.

howardjones commented 3 years ago

Closing. Once I got the file search working, the output wasn't really what I'd hoped for. Some python and pandoc did it for me in the end.

MaxMelcher commented 3 years ago

What was the difference/what is missing?