Giter Site home page Giter Site logo

nobuhito / vscode.printcode Goto Github PK

View Code? Open in Web Editor NEW
73.0 9.0 26.0 813 KB

PrintCode added printing function to VS Code!!

Home Page: https://marketplace.visualstudio.com/items?itemName=nobuhito.printcode

License: MIT License

JavaScript 100.00%
vscode-extension

vscode.printcode's Introduction

version installs rating trendDaily trendWeekly trandMonthly

PrintCode - Extension of VS Code

You can print the code from VSCode!

Product page

README for Japanese

Blog for Japanese

image

Marketplace

https://marketplace.visualstudio.com/items?itemName=nobuhito.printcode

Features

PrintCode converts the code being edited into an HTML file, displays it by browser and prints it.

Usage

  1. Press the F1 key
  2. Select or type PrintCode
  3. The browser launches and displays the code
  4. A print dialog opens and you can print!!

Configuration Options

Key Default Description
tabSize 2 The number of spaces a tab is equal to
fontSize 12 Controls the font size in pixels
paperSize a4 Paper size and orientation
lineNumbers on Print line numbers
printFilePath filename Amount of file's path info in document title
browserPath none Open with your non-default browser
webServerPort 4649 Port number for local WebServer.
disableTelemetry false Dont't include Google Analytics code on page
autoPrint true Pop up print dialog automatically
additionalStyleSheet none Insert additional StyleSheet

Release Notes

See Changelog.

Thank you

@janilahti (#6, #7, #12)

I like osushi/お寿司 very much.

vscode.printcode's People

Contributors

nobuhito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode.printcode's Issues

Not working

installed it on VS under Ubuntu.

When triggering the PrintCode command nothing happens. No message in the output window, no error in the developer tools

Missing line number on fist page.

Im trying print some code, but i have no line number on fist page, on Firefox browser.
But on Chrome has line number.
Firefox has custom header, Chrome not while printing.

Feature Request: Reflect code folding on printout

I have an ASP file with a whole bunch of functions defined. I display the file as function names only, by using the Code Folding feature of VSCode.

When printing out, I would like it if the printout reflected the way I have the code folded. If it's not visible on screen, don't print it. (Maybe add a little "+" icon in the left margin to show that something is folded here, just as it does on screen.)

Thank you so much for this plugin. I laughed out loud when I realized VSCode doesn't have a print function!

VSCODE Dark theme in print

I need VSCODE Dark theme in print.
Either it has to select the defult theme in my vscode or else let me pick a theme during printing

Extra page

I'm not sure if it's Firefox, my print driver, or the extension, but for some reason I keep getting an extra (unneeded) page... no matter how much text is on the actual last page. I'm printing letter size (not A4), but I don't think that should matter. Any suggestions?

A5 paper size

Could you please add settings option for A5 paper size?

"printcode.paperSize": {
	"type": "string",
	"description": "Paper size and orientation.",
	"enum": [
		"a4",
		"a4Land",
		"letter",
		"letterLand",
		"a5"
	],
	"default": "a4"
}

Thanks.

Link the markdown- color syntax

Hey, would be nice if the product would support the markdown color-syntax out of the box. In my opinion, the way to go. This would enormous boost your great product-value.

There is no matching command

I've tried uninstalling reinstalling and closing VSCode and opening again and have had no luck on seeing the PrintCode command on the command palette. Any way to fix this? Thanks

Prints in Black and White only

I have tried Chrome and Opera but cannot seem to get PrintCode to print in colour. It prints perfectly but only in Black & White so we lose all the syntax highlighting.
screenshot_2

Browser does not open in WSL

Running PrintCode in Remote-WSL fails to open the browser due to xdg-open not being installed and no default browser set.

Question about Letter and Legal, Request for Tabloid

Hi Nobuhito,

Thanks so much for your work on this extension, it is very useful!

I have a question and a feature request:

  1. I notice that for the Letter and Legal paper types your mm measurements are different than I am used to:
    Letter 216mm x 279mm (I notice you use 280)
    Legal 216mm x 356mm (I notiec you use 357)
    Is there a reason for this?

  2. Could you add support for Tabloid?
    279mm x 432mm

Much Thanks!
Scott

Print from 2nd instance of vscode

When i have multiple instances of vscode open (as i do have periodically), if i print from the second instance then the browser opens with the active file of the first instance.

Cannot use in remote-containers

How to reproduce:

  1. run a docker container
  2. mount into it with vscode remote-containers
  3. install printcode from local installed extensions
  4. print code and there's no response

Add Configuration to use non-default browser

Thank you for the clever workaround to fix the glaring miss on Microsoft's part as it pertains to print functionality!

There does, however, seem to be an issue with non-edge IE and this extension.

Could you create a configuration that would allow a user to select which browser to use? I'm not quite sure how this could be achieved, or if it is even possible.

Word Wrap

Having an issue with word wrap when printing. I'm printing to A4 size paper but PrintCode doesn't seem to include the full width of the paper for the code. It wraps the text, almost at half way across the page.
If I increase or decrease the font size it still wraps at that mid point across the page.
This shows the same in Chrome and Firefox
firefoxwebpage
chromewebpage
chromeprintpreview
chromeprintpreview

More print options

Right now it cannot print in landscape orientation, even switch to system print dialog. Any solution ? Thanks.

Print mode for shell scripts does not work

mode equals undefined when printing shell scripts. Looking through the source, the issue lies in how VS Code reports back the languageId.

VS Code uses shellscript for the languageId while CodeMirror expects it to be shell. This mismatch causes the language to be returned as undefined.

Adding the following in funcs.js after line 3 fixes the immediate issue but I'm sure there are other languages with similar mapping issues:

  if (language == 'shellscript') {
    language = 'shell';
  }

Let me know if you want me to submit a PR for this fix.

Trouble printing on a Mac

I am running Mac OS 10.11.6, Visual Studio Code 1.20.1. When I run PrintCode, an empty broswer window appears.

Color syntax between differents languages

The color syntax in some languages isn't properly printed, even not in some case.
In C++, there are only comments and number. In markdown, code blocks look like comments.
Then i installed a extension which change color of parenthesis each level of them.

So, is it possible to get the "VS Theme", kind of ?

EDIT: I just looked the source, it seems that the extension uses codemirror to color the text. I'm not an expert of vscode API but I'm sure there's a way to retrieve color data from the document and build your own HTML from these values.

Option to disable/enable ligatures

I had to go into Chrome Devtools to insert one line of CSS to remove the ligatures from my coding font so that my professor doesn't go "wtf are these symbols".
I feel like it would be better as a configuration option instead of having to manually set it each time.

About font color.

The font color is follow from VS Code?
Or from this PrintCode project?
Thank you.

How to add stylesheets?

I usually write code in AnyScript (yes, it's minor), and I want to be able to highlight the syntax using PrintCode.
Reading other related posts, I now know that I can go to CodeMirror, and somehow highlight my syntax (I'm not even sure this is correct...)
Could someone please help me through the steps to adding new stylesheets to PrintCode?

Printed scrollbar covers last line on page

Version 3.0.0
Using default settings except for paper size, which I set to letter.
Browser: Edge

When printing in portrait on letter size, the HTML output looks good, but on the printout, a scrollbar is being printed over the last line on the page. This is occurring on every page.

🔥Can I print all files at once?

Loving this plugin.

Whenever I have to review a big amount of code, I print out the files I need to review, go to the park, and do this in the sun, under a tree.

One problem though. It can take a while to print out all files I need, since you can only print one file at a time. Would there be a way to print all my files, all folder structure, and all outlines? That would make my life so much easier? I'd have to work from under a tree 6 hours every day! :')

Hope someone can help. email me at vscode AT karsens DOT com

Mode HTMLEbmedded Doesn't Work

Trying to print a HTML Embedded file doesn't work and returns an error Uncaught TypeError: CodeMirror.multiplexingMode is not a function. To resolve include the addon/mode/multiplex library.

Print PHP

image
Every time I try to print a PHP page I get a blank page.

Issues with configuration

I added this to my user settings:

"printcode.fontSize": 10,
"printcode.lineNumbers": "off"

and the lineNumber still appear when i try to print.

Any idea what I could be doing wrong?

Thanks!

Unable to print: No permission to use port undefined.

I am running latest version 3.0.0 on Windows 7 with Chrome as default browser and always get the same error when trying to print:

Unable to print: No permission to use port undefined. Please set different port number in User Settings: printcode.webServerPort and Reload Window.

I have tried different port numbers in the settings but nothing changes. Chrome always says:

Cannot print: localhost refused to connect.

I am not running any web server. Is this required in order to print?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.