iBook - jak vložit zdrojový kód

Pomocí MacVim

I just tried the trick I use to get syntax-highlighted code into Keynote, and I think it works, though I don't have an iPad handy to export the book and try it.

Edit the code in MacVim
Make sure syntax highlighting is on:

  1. Hit escape
  2. Type ":syn on" and hit return (don't type the quotes)
  3. If you don't see syntax highlighting, you may have vim mis-installed or are using a language that doesn't have a highlighting file installed by default; search github and you'll probably find something
  4. Export the buffer as HTML
  5. Hit escape
  6. Type ":TOhtml" and hit return (don't type the quotes)
  7. This will open a second buffer with the HTML of your text in it. Save it via ":w" and hitting return
  8. Open the file in your browser
  9. Copy the contents
  10. Paste inside iBooks Author

When I did this, I got a text box with the highlighted code in it.

Zdroj:
https://apple.stackexchange.com/questions/37706/embedding-code-snippets-in-ibooks-author

Výběr barevného schématu

Tmavé


Zdroj:




Žádné komentáře:

Okomentovat

Server Side Rendering - Next

The Benefits of Server Side Rendering Over Client Side Rendering