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

Change Title Text #25

Open
bibbca opened this issue Oct 24, 2017 · 2 comments
Open

Change Title Text #25

bibbca opened this issue Oct 24, 2017 · 2 comments

Comments

@bibbca
Copy link

bibbca commented Oct 24, 2017

I would love functionality to be able to change the <title>Writing</title> text so when I export to pdf I could have the actual title in the upper left corner.

@tsoldaat
Copy link

I mostly write small reports and such with Writing and consider the text of the first <h1> to be the document title. So I added setting the title to the print-routine, like so:

if (e.keyCode == 80 && e.ctrlKey) {    // CTRL + P 
    if (mode != 1) {
        mode = 1;
        $('#wmd-input').hide();
        $('#wmd-preview').show();
        $('body').removeClass('fixedheight');
        $('html').removeClass('fixedheight');
        firstH1 = $('#wmd-preview').find('h1').text(); // Get content of first H1
        $('title').html(firstH1);                      // Set title using firstH1
        e.preventDefault();
        window.print();
        return false;
    }
[...]

HTH

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

3 participants
@tsoldaat @bibbca and others