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

using .innerHTML makes JSON reappear (closes #478) #490

Merged
merged 2 commits into from Sep 13, 2015

Conversation

marcoscaceres
Copy link
Member

For whatever reason, .innerText means that when .toString() is called within the output function, the inner text doesn't show up. However, using .innerHTML means that it does show up.

@marcoscaceres
Copy link
Member Author

Tested in Safari, Chrome, and FF on Mac.

@marcoscaceres
Copy link
Member Author

@iherman, I'm still not comfortable with this. Maybe it's better if you tell us exactly which fields you actually need for what you are doing?

@iherman
Copy link
Member

iherman commented Sep 9, 2015

@marcoscaceres I am not sure what you ask. Are you asking what I would use the respec config from my code if it was there?

If so: at this moment it would give me an easy way of finding, e.g., the publication date, the short name, the list of editors and authors, the document status and probably other things. All these information are in the initial respec setup but are thrown away; I must scrape the HTML output to find them. (Eg, find the latest URL relying on a particular class name, extract from the URL format whether it is a REC, or WD, or whatever, and extract the publication date.) I am sure other tools that may want to postprocess the HTML file may find other usage.

(If it was only for my tool then I wouldn't have raised this feature request. After all, I have already gone through the trouble of doing it, although it is not future proof as it relies on a particular, and undocumented, structure of the final HTML.)

@marcoscaceres
Copy link
Member Author

On Sep 9, 2015, at 1:11 AM, Ivan Herman notifications@github.com wrote:

@marcoscaceres I am not sure what you ask. Are you asking what I would use the respec config from my code if it was there?

If so: at this moment it would give me an easy way of finding, e.g., the publication date, the short name, the list of editors and authors, the document status and probably other things.

Ok, in addition to the above, I want to know the list that makes up "probably other things" (I can make it "all use-setable options, as per our documentation). We are vomiting a lot of ReSpec's internals into the JSON, and I would prefer to only spit out the properties you + others need.

All these information are in the initial respec setup but are thrown away; I must scrape the HTML output to find them. (Eg, find the latest URL relying on a particular class name, extract from the URL format whether it is a REC, or WD, or whatever, and extract the publication date.) I am sure other tools that may want to postprocess the HTML file may find other usage.

(If it was only for my tool then I wouldn't have raised this feature request. After all, I have already gone through the trouble of doing it, although it is not future proof as it relies on a particular, and undocumented, structure of the final HTML.)


Reply to this email directly or view it on GitHub.

@iherman
Copy link
Member

iherman commented Sep 9, 2015

@marcoscaceres I would say that anything that the user can set should be visible to the output. We should not come up with a list of "visible" properties imho.

@marcoscaceres
Copy link
Member Author

Sent from my iPhone

On Sep 9, 2015, at 1:26 AM, Ivan Herman notifications@github.com wrote:

@marcoscaceres I would say that anything that the user can set should be visible to the output. We should not come up with a list of "visible" properties imho.

The problem is that ReSpec abuses the user's configuration to also configure its own things. What I will do is snapshot the initial configuration (before ReSpec starts changing it) and return that. That should give you what you need without exposing ReSpec's internal config. Sound good?


Reply to this email directly or view it on GitHub.

@iherman
Copy link
Member

iherman commented Sep 9, 2015

On 09 Sep 2015, at 07:34 , Marcos Caceres notifications@github.com wrote:

Sent from my iPhone

On Sep 9, 2015, at 1:26 AM, Ivan Herman notifications@github.com wrote:

@marcoscaceres I would say that anything that the user can set should be visible to the output. We should not come up with a list of "visible" properties imho.

The problem is that ReSpec abuses the user's configuration to also configure its own things. What I will do is snapshot the initial configuration (before ReSpec starts changing it) and return that. That should give you what you need without exposing ReSpec's internal config. Sound good?

That sounds perfect. Thanks!

@@ -21,7 +21,7 @@ define(
}
return val;
}
script.innerText = JSON.stringify(conf, confFilter, 2);
script.innerHTML = JSON.stringify(conf.initialUserConfig, confFilter, 2);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, innerText doesn't work... it doesn't output when respec calls .innerHTML on the root node.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why this wouldn't work, but frontend dev is full of mysteries.

@marcoscaceres
Copy link
Member Author

@tobie r?

@@ -23,6 +23,16 @@
, embedded = (top !== self)
;
if (!("respecConfig" in window)) window.respecConfig = {};
// clone the initial user configuration.
try{
if(Object.assign){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what the convention us but iirc ReSpec has ws all over the place.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going to fix all that in #493.

@tobie
Copy link
Member

tobie commented Sep 13, 2015

LGTM

@marcoscaceres
Copy link
Member Author

@tobie thanks for the review + time!

marcoscaceres pushed a commit that referenced this pull request Sep 13, 2015
using .innerHTML makes JSON reappear (closes #478)
@marcoscaceres marcoscaceres merged commit 78b2084 into develop Sep 13, 2015
@marcoscaceres marcoscaceres deleted the export_config_fixup branch September 13, 2015 16:35
@marcoscaceres marcoscaceres restored the export_config_fixup branch September 14, 2015 17:06
shikhar-scs pushed a commit to shikhar-scs/respec that referenced this pull request Feb 19, 2018
…accessor on line graphs using tspans. Next step is to implement the argument, then generalize this for the other graph types.
shikhar-scs pushed a commit to shikhar-scs/respec that referenced this pull request Feb 19, 2018
…d to come up with an example for functions.
shikhar-scs pushed a commit to shikhar-scs/respec that referenced this pull request Feb 19, 2018
shikhar-scs pushed a commit to shikhar-scs/respec that referenced this pull request Feb 19, 2018
shikhar-scs pushed a commit to shikhar-scs/respec that referenced this pull request Feb 19, 2018
shikhar-scs pushed a commit to shikhar-scs/respec that referenced this pull request Feb 19, 2018
shikhar-scs pushed a commit to shikhar-scs/respec that referenced this pull request Feb 19, 2018
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

3 participants