yzane / vscode-markdown-pdf

Markdown converter for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=yzane.markdown-pdf
Other
1.01k stars 206 forks source link

Option to omit file extension from title #209

Open KillyMXI opened 4 years ago

KillyMXI commented 4 years ago

Having .md mentioned in the header is not terribly useful.

The simplest option could be to omit the file extension from Title.

Alternatively, Title could be separated, and Filename introduced for the template options to capture the existing behavior.

Title can use the top header in case it's the only one of that level in the document, or fallback to the file name without extension.

This is related to #173 and #193 but different. This issue is about better automatically chosen title.

ghost commented 2 years ago

To omit the file extension from the title, you can change this line: https://github.com/yzane/vscode-markdown-pdf/blob/master/extension.js#L327 Change it to var title = path.parse(uri.fsPath).name;, save extension.js and (re)open VS Code. On my Mac the file was located inside: ~.vscode/extensions/yzane.markdown-pdf-1.4.4.

jordanbarnes94 commented 1 year ago

I would also prefer that the .md file extension was not included in the of the HTML.</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>