Comments (6)
http://stackoverflow.com/a/12244248
I think we can only support this feature if the document has a TOC 😒
from asciidoc-googledocs-addon.
That's really interesting... but it's a fine workaround, right? If you have a lot of internal links, you could add a TOC before converting. I would find that useful.
from asciidoc-googledocs-addon.
That's really interesting... but it's a fine workaround, right? If you have a lot of internal links, you could add a TOC before converting. I would find that useful.
Yes with this workaround I think it will be possible to resolve "link ids" (ie. #heading=h.cughuow97z4o
) to their corresponding headings titles. So I may be able to create proper local xrefs.
However it's not possible to create a Table Of Contents. So basically if a TOC is not already present in the document we can't do nothing.
from asciidoc-googledocs-addon.
So we can detect the presence of a toc, and we can detect internal
hyperlinks. If a doc has internal links but no toc, we can echo to the ui
that adding a toc will enable those links.
I'm happy to take a swipe at this one if you want. I just haven't looked at
the DOM or seen what we're working with yet, so can't tell if I'll be in
over my head wrestling with this stuff.
On Jul 23, 2016 16:40, "Guillaume Grossetie" [email protected]
wrote:
That's really interesting... but it's a fine workaround, right? If you
have a lot of internal links, you could add a TOC before converting. I
would find that useful.Yes with this workaround I think it will be possible to resolve "link ids"
(ie. #heading=h.cughuow97z4o) to their corresponding headings titles. So
I may be able to create proper local xrefs.However it's not possible to create a Table Of Contents. So basically if a
TOC is not already present in the document we can't do nothing.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#21 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABNKMXGUbxkihXqXtcRrG8MVv716oHoOks5qYnxagaJpZM4JR-O6
.
from asciidoc-googledocs-addon.
I'm happy to take a swipe at this one if you want. I just haven't looked at
the DOM or seen what we're working with yet, so can't tell if I'll be in
over my head wrestling with this stuff.
Sure!
The entry point is the document body : Code.gs#L49
Then we iterate on children : Code.gs#L50
Each child
is an Element
: https://developers.google.com/apps-script/reference/document/element
An Element
can be a TableOfContents
: https://developers.google.com/apps-script/reference/document/table-of-contents
The Google Apps Scripts documentation is pretty clear and you should find all the information there. When in doubt you can use a Logger to debug: https://developers.google.com/apps-script/reference/base/logger
Let me know if you need help 😉
from asciidoc-googledocs-addon.
Very cool; thanks for the cheat sheet.
On Sat, Jul 23, 2016 at 6:21 PM, Guillaume Grossetie <
[email protected]> wrote:
I'm happy to take a swipe at this one if you want. I just haven't looked at
the DOM or seen what we're working with yet, so can't tell if I'll be in
over my head wrestling with this stuff.Sure!
The entry point is the document body
https://developers.google.com/apps-script/reference/document/document#getBody()
: Code.gs#L49
https://github.com/Mogztter/asciidoc-googledocs-addon/blob/master/app/Code.gs#L49Then we iterate on children
https://developers.google.com/apps-script/reference/document/body#getChild(Integer)
: Code.gs#L50
https://github.com/Mogztter/asciidoc-googledocs-addon/blob/master/app/Code.gs#L50Each child is an Element:
https://developers.google.com/apps-script/reference/document/elementAn Element can be a TableOfContents:
https://developers.google.com/apps-script/reference/document/table-of-contentsThe Google Apps Scripts documentation is pretty clear and you should find
all the information there. When in doubt you can use a Logger to debug:
https://developers.google.com/apps-script/reference/base/loggerLet me know if you need help 😉
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#21 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABNKMVRupt9Il7D1VDyXAAs_M3KWoOp1ks5qYpP1gaJpZM4JR-O6
.
from asciidoc-googledocs-addon.
Related Issues (20)
- Formatting preferences and options HOT 2
- Remove spaces prepended to list items
- Force blank line above lists
- Remove extraneous "false" headings
- Merge with gdoc2adoc project HOT 5
- Level 1 and Level 2 headers HOT 1
- Importing asciidoc to googledoc HOT 2
- Inline code not converted HOT 6
- Not verified by Google error. HOT 15
- Disable list continuation (attributes, conditional processing, and more?) HOT 4
- AsciiDoc no longer shows up in Add-on menu HOT 6
- limit permissions HOT 1
- ScriptError: TypeError: child.editAsText is not a function HOT 5
- Explain how source blocks are recognized in a Google Docs
- DocumentApp.PositionedImage#getBlob can throw an exception
- Ignore unsupported child in a Google document
- Only the first paragraph in a table celle is converted, while the other paragraphs are lost in translation HOT 3
- Authorization is required HOT 14
- Feature Request: Export one sentence per line (ventilated prose) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asciidoc-googledocs-addon.