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

Add images support #6

Merged
merged 5 commits into from
Apr 27, 2016
Merged

Conversation

rafaelrinaldi
Copy link
Collaborator

This PR adds image support to slides (thanks to iTerm).

# Images

![ron](ron.png)

Ron Swanson and his ice cream

![pizza](pizza.png)

There's anything a pizza can't solve

demo

Notes

  • Will parse markdown images (does not support HTML image tags)
  • Will do nothing if terminal does not support images (currently a simple check to TERM_PROGRAM to figure it out)
  • Add images option which is true by default (let me know if it should be false by default)
  • User can turn off images with --no-images

Let me know if PR looks good. I can make any adjustments if needed.

Add images support for terminals that support it.
@dominictarr
Copy link
Collaborator

cool, my terminal (on linux doesn't support this) but it doesn't do anything weird, so I'll merge.
can you add an example image to the readme so that all tslide features are demonstrated via the readme?

@rafaelrinaldi
Copy link
Collaborator Author

@dominictarr Done. What do you think?

@dominictarr
Copy link
Collaborator

that image doesn't display in github, I think you need to use an relative link, and check it into the repo.
Also, especially, you could you put the embedded image in image section?

@rafaelrinaldi
Copy link
Collaborator Author

@dominictarr Done.

@dominictarr
Copy link
Collaborator

you are missing screenshot.png

@rafaelrinaldi
Copy link
Collaborator Author

@dominictarr That's not needed anymore. See: https://github.com/rafaelrinaldi/tslide/tree/feat/images

@dominictarr
Copy link
Collaborator

okay, just one more thing: this currently loads files relative to the cwd (i think, can't test) but pretty sure that is what happens when you do fs.readFileSync(filename)

Of course, the filenames should be relative to the md file, so it should be dir=path.dirname(input); fs.readFileSync(path.join(dir, filename))

otherwise, you can't do tslide ../README.md

@rafaelrinaldi
Copy link
Collaborator Author

@dominictarr Good catch. Fixed too.

@rafaelrinaldi rafaelrinaldi merged commit 63b8580 into tslide:master Apr 27, 2016
@rafaelrinaldi rafaelrinaldi deleted the feat/images branch April 27, 2016 14:19
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

Successfully merging this pull request may close these issues.

None yet

2 participants