Coder Social home page Coder Social logo

lukehalley / atom-asciidoc-image-helper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from asciidoctor/atom-asciidoc-image-helper

0.0 2.0 0.0 189 KB

⚛ Tool to make insertion of images into AsciiDocs easier in the Atom editor.

Home Page: https://atom.io/packages/asciidoc-image-helper

License: MIT License

CoffeeScript 100.00%

atom-asciidoc-image-helper's Introduction

AsciiDoc Image Helper

Atom Package Atom Package Downloads Build Status Build status Gitter MIT License

An Atom plugin to facilitate insertion of images in an AsciiDoc document.

Create an image file, in the specified folder, that is named after the AsciiDoc file it is pasted into, and insert an image reference to that file into the editor.

Originally forked from markdown-image-helper.

Basic Usage

  1. Take a screenshot or copy an image to the clipboard.
  2. Paste it into Atom AsciiDoc editor.
  3. See that the 'Images Folder' has a new png file, and an image reference was inserted into the editor with the correct filename.

The default setting is to place copied and created a folder named images in the same folder as the document.
Another default setting is to expect that the :imagesdir: attribute is not set in the document (or through cli) and sets the 'Append Images Folder' setting to true. This setting will append the Images Folder path to the filename in the image:[] macro so that AsciiDoctor knows where to find the files.

NOTE: To increase flexibility for moving your images folder, and to also reduce the repetition of hard coded image folder strings in the document; it is recommended to set the :imagesdir: attribute for your document to match the 'Images Folder' setting in this package and to disable the 'Append Images Folder' option.
This way, the package will know where to place your image files, and asciidoctor will know where to find them.

If you want to move your folder of images into a new directory called something like assets you would change the Folder Location string to assets/images, and set this same thing as the value of the :imagesdir: attribute in the document.
Make sure the setting to 'Append Images Folder' is not checked.
Now everything should just work as expected in the new location, without requiring a Find/Replace operation over all of the documents that have hard coded the images folder into the image macros.

Notes for Windows Users

To take a screenshot to the clipboard.

Use PrintScr to capture your entire desktop.
Use Alt + PrintScr to capture the active window.

When copying an existing file on your local system into the document.

  1. Open Windows Explorer and find your file.
  2. Press Shift and right-click with your mouse.
  3. Your pop up menu will have several more options.
  4. Select Copy as Path.
  5. Paste into the editor.

Notes for Mac OS X Users

To take a screenshot to the clipboard.

Use Command-Shift-Control-4 to capture the image data to the clipboard.

When copying an existing file on your local system into the document.

  1. Navigate to the file or folder you wish to copy the path for.
  2. Right-click (or Control+Click, or a Two-Finger click on trackpads) on the file in the Mac Finder.
  3. While in the right-click menu, hold down the OPTION key to reveal the "Copy (item name) as Pathname" option, it replaces the standard Copy option.
  4. Once selected, the file or folders path is now in the clipboard, ready to be pasted into the document.
    Note: The copied pathname is always the complete path, it’s not relative.

Install

Settings/Preferences > Install > Search for asciidoc-image-helper

or

apm install asciidoc-image-helper

Credits

Special thank you to Ludovic Fernandez 'ldez' for turning this package into a legit project. I am learning a lot from his pull requests.

atom-asciidoc-image-helper's People

Contributors

bwklein avatar ldez avatar bigyuki avatar mojavelinux avatar

Watchers

James Cloos avatar Luke Halley avatar

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.