All Projects → alexwforsythe → Code Blocks

alexwforsythe / Code Blocks

Licence: mit
Syntax highlighting for Google Docs

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Code Blocks

Nord Jetbrains
An arctic, north-bluish clean and elegant JetBrains IDE UI and editor color theme.
Stars: ✭ 293 (-30.57%)
Mutual labels:  syntax-highlighting
Vim Crystal
Vim filetype and tools support for Crystal language.
Stars: ✭ 326 (-22.75%)
Mutual labels:  syntax-highlighting
Highlight.js
JavaScript syntax highlighter with language auto-detection and zero dependencies.
Stars: ✭ 19,312 (+4476.3%)
Mutual labels:  syntax-highlighting
Devii
A developer blog starter for 2020 (Next.js + React + TypeScript + Markdown + syntax highlighting)
Stars: ✭ 296 (-29.86%)
Mutual labels:  syntax-highlighting
Ble.sh
Bash Line Editor―a full-featured line editor written in pure Bash! Syntax highlighting, auto suggestions, vim modes, etc. are available in Bash interactive sessions!
Stars: ✭ 306 (-27.49%)
Mutual labels:  syntax-highlighting
Rainbow csv
🌈Rainbow CSV - Vim plugin: Highlight columns in CSV and TSV files and run queries in SQL-like language
Stars: ✭ 337 (-20.14%)
Mutual labels:  syntax-highlighting
Refractor
Lightweight, robust, elegant virtual syntax highlighting using Prism
Stars: ✭ 291 (-31.04%)
Mutual labels:  syntax-highlighting
Asm Dude
Visual Studio extension for assembly syntax highlighting and code completion in assembly files and the disassembly window
Stars: ✭ 3,898 (+823.7%)
Mutual labels:  syntax-highlighting
History Search Multi Word
Multi-word, syntax highlighted history searching for Zsh
Stars: ✭ 314 (-25.59%)
Mutual labels:  syntax-highlighting
Highlight
Rich featured syntax highlighter for Keynote slides.
Stars: ✭ 367 (-13.03%)
Mutual labels:  syntax-highlighting
Chromatica.nvim
Clang based syntax highlighting for Neovim
Stars: ✭ 306 (-27.49%)
Mutual labels:  syntax-highlighting
Lowlight
Virtual syntax highlighting for virtual DOMs and non-HTML things
Stars: ✭ 310 (-26.54%)
Mutual labels:  syntax-highlighting
Webstorm Styled Components
styled-components highlighting support in IntelliJ editors
Stars: ✭ 342 (-18.96%)
Mutual labels:  syntax-highlighting
Color Themes For Google Code Prettify
Syntax highlighting color themes for Google Code Prettify
Stars: ✭ 297 (-29.62%)
Mutual labels:  syntax-highlighting
Packagedev
Tools to ease the creation of snippets, syntax definitions, etc. for Sublime Text.
Stars: ✭ 378 (-10.43%)
Mutual labels:  syntax-highlighting
Handlebars
Fullest Handlebars.js templating support for Atom and Sublime Text 2 / 3. Also drives syntax colouring on Github and in Visual Studio Code. Install from: https://atom.io/packages/Handlebars and https://packagecontrol.io/packages/Handlebars.
Stars: ✭ 292 (-30.81%)
Mutual labels:  syntax-highlighting
Clangkit
ClangKit provides an Objective-C frontend to LibClang. Source tokenization, diagnostics and fix-its are actually implemented.
Stars: ✭ 330 (-21.8%)
Mutual labels:  syntax-highlighting
Rainbow levels.vim
A different approach to code highlighting.
Stars: ✭ 415 (-1.66%)
Mutual labels:  syntax-highlighting
Enlighterjs
🔆 an open source syntax highlighter written in pure javascript
Stars: ✭ 379 (-10.19%)
Mutual labels:  syntax-highlighting
Nano Highlight
a spiffy collection of nano syntax highlighting files
Stars: ✭ 344 (-18.48%)
Mutual labels:  syntax-highlighting

img

clasp Donate

Usage

Installation

Code Blocks is available on the G Suite Marketplace. Select Install to begin using it in Google Docs.

Starting the add-on

starting

Formatting inline code

inline-formatting

Formatting code blocks

blocks-formatting

Reformatting code blocks

reformatting-blocks

Previewing themes

Examples of the different color themes applied to various languages can be found on the highlight.js demo page.

Unformatting code

To clear formatting in Docs, highlight the text and select Format > Clear Formatting from the toolbar. The keyboard shortcut is Cmd+/ on OS X and Ctrl+/ on Windows: https://support.google.com/docs/answer/179738

This will not remove the table that the text lives in if it's a "code block". To do that, you'll have to copy the text and paste it outside the table, then right-click the table and select Delete table.

Limitations

Updates to syntax highlighting

Code Blocks is built with highlight.js and can only provide syntax highlighting for languages that are supported by that library.

If you'd like to see Code Blocks support a language that is not yet implemented by highlight.js, please refer to their page on requesting new languages.

If you'd like to see Code Blocks update or fix support for an existing language:

  1. Check if the latest version of highlight.js already includes the update. If it does, submit a PR to this repository that bumps the highlight.js version in package.json.
  2. If highlight.js does not yet include the update, please submit an issue on their issue tracker.

Real-time syntax highlighting

Codes Blocks uses Google's Apps Script, a server-side JavaScript platform, to interact with Docs and format code. Each time the add-on formats a snippet of code, a request is made to the Apps Script backend to modify the current Doc. There are a few limitations of this platform that prevent Code Blocks from formatting code as you type:

  • The onEdit event that fires when a user modifies content is only available in Sheets
  • Time-driven triggers can only be used once per hour at most
  • Each request to modify the current Doc can take multiple seconds, so code formatting cannot be performed in real-time
  • The number of requests needed to update a Doc in near real-time may exceed the service API quotas

Keyboard Shortcuts

Keyboard shortcuts can only be handled by Code Blocks if the add-on sidebar is focused, which would require users to click the sidebar anyway.

Keyboard events in the active document cannot currently be handled by Docs add-ons: https://issuetracker.google.com/issues/79461369

Contributing

Setup

$ npm install

Building

$ npm run build

Pushing Changes

NOTE: The following commands only work for the project maintainer because they require Google Drive authorization.

Command Description
npm run push:gas just GAS files
npm run push:js just sidebar.js
npm run push:static just HTML & CSS
npm run push everything

Google Apps Script Resources


Homepage | G Suite Marketplace | Privacy Policy | Terms of Service

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].