Open-Systems-Pharmacology / Reporting-Engine

(Matlab) Reporting-Engine
Other
1 stars 8 forks source link

Generated Sections: Titles are not used to create folder name #84

Closed msevestre closed 5 years ago

msevestre commented 5 years ago

In the minimal example, the Sections are defined like so

 "Sections": [
    {
      "Id": 1,
      "Title": "Chapter 1",
      "Content": "/Content/Section1.md"
    },
    {
      "Id": 2,
      "Title": "Chapter 2",
      "Content": "/Content/Section2.md",
      "Sections": [
        {
          "Id": 3,
          "Title": "Chapter 2.1",
          "Content": "/Content/Section2.1.md"
        }
      ]
    }
  ]

What is created is however Chapter_1, Chapter_2 etc.. why?

msevestre commented 5 years ago

@Yuri05 @pchelle Bug or feature? The Folder text will be used to create the table of content. If we start to mess around with how it's displayed, it will be surprising for the user!

If we expect invalid windows characters to be part of the title, then we need to dump a _title.md file or something like that that will contain the title.

Thoughts?

Yuri05 commented 5 years ago

If we expect invalid windows characters to be part of the title

With the latest knowledge: yes, we do expect invalid characters as part of the title. Thus we should either forbid those characters in titles or (better) replace them in generated folder names

msevestre commented 5 years ago

This is done already right?

pchelle commented 5 years ago

Yes, special characters are replaced by '_' in the folder names. And the following file _title.md is created with the name as specified by the user.

Yuri05 commented 5 years ago

tried it today - didn't work for the piece below. had to remove ":" in the titles

"Sections": [
        {
            "Id": 1,
            "Title": "Chapter 1: Introduction to OSP",
            "Content": "https://raw.githubusercontent.com/Incei/Pediatric-Ontogeny-Qualification/master/OSPS%20Introduction.md"
        },
        {
            "Id": 4,
            "Title": "Chapter 2: Introduction to Pediatric Translation",
            "Content": "https://raw.githubusercontent.com/Incei/Qualification-Ontogeny-Distribution-GFR/master/README.md"
        },
        {
            "Id": 2,
            "Title": "Chapter 3: Adult PBPK-Model performance",
            "Content": "Content/Section2.md"
        },
        {
            "Id": 3,
            "Title": "Chapter 4: Pediatric translation qualification",
            "Content": "Content/Section3.md"
        }
],
pchelle commented 5 years ago

I am using a function that was already in the Reporting Engine and called: removeForbiddenLetters Indeed, the function replaces the following letters "./ ?§$%&( )[ ]{ }+~*#" but not ":" I can add it in the function if it is okay.

Yuri05 commented 5 years ago

I can add it in the function if it is okay.

Yes, do it please. @KatrinCoboeken FYI

Yuri05 commented 5 years ago

fixed with previous PRs