Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: Consider multiline titles as two markdown headers #57

Open
sharky98 opened this issue Apr 19, 2024 · 0 comments
Open

Comments

@sharky98
Copy link

I often saw presentation that uses a single text box to provide a multiline title, where the first line is the main section and the second line is the more specific section.

Either behind a option flag or using a specific layout of the title file, it would be a nice feature that if such title block are found, the first line is considered as an header of level 1 (or what the title.txt says it should be) and the second line is considered as an header of level 2 (or what the title.txt says it should be).

See the demo-subtitle.pptx presentation that I made to explain it better.

Actual Behavior

Output of pptx2md demo-subtitle.pptx --out demo-subtitle.md --disable-escaping

# Section Title

My content 1

My content 2

# Section Title�Sub-Title Made with « enter »

My content 1.1

My content 1.2

# Section Title�Sub-Title using « shift+enter »

My content 2.1

My content 2.2

# Section Title	Sub-Title 3 on same line – Made with « tab »

My content 3.1

My content 3.2

# Section Title that is very long so that it is on two line without using « enter »

My content 4.1

My content 4.2

You will see that the output use the character (U+000B) for both subtitle made with enter. The one with the tab doesn't show well in the render, but if you use an editor that shows tab, you will see that between Title and Sub-Title, the character used is U+0009.

Feature Behavior

I expect either behavior to be behind a enable or disable flag.

I think the algorithm could be something along the line:

  • If U+000B or U+0009 are encountered in what is recognized as a title block
    • Split text in before and after
    • If before match the previous title OR the previous header level title
      • Output after as one header level X+1, where X is the header level of before
    • Else
      • Output before as header level X
      • Output after as header level X+1

Without title.txt

# Section Title

My content 1

My content 2

## Sub-Title Made with « enter »

My content 1.1

My content 1.2

## Sub-Title using « shift+enter »

My content 2.1

My content 2.2

## Sub-Title 3 on same line – Made with « tab »

My content 3.1

My content 3.2

# Section Title that is very long so that it is on two line without using « enter »

My content 4.1

My content 4.2

With a title.txt

First Header
  Section Title
    Sub-Title Made with « enter »
    Sub-Title using « shift+enter »
    Sub-Title 3 on same line – Made with « tab »
  Section Title that is very long so that it is on two line without using « enter »
## Section Title

My content 1

My content 2

### Sub-Title Made with « enter »

My content 1.1

My content 1.2

### Sub-Title using « shift+enter »

My content 2.1

My content 2.2

### Sub-Title 3 on same line – Made with « tab »

My content 3.1

My content 3.2

## Section Title that is very long so that it is on two line without using « enter »

My content 4.1

My content 4.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant