You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, the idea of providing a human-readable version is remarkable, thank you, guys! It just happens when you want to pin a lot of links to do a comparison or summarizing. The PIN panel would take over all the room of the sidebar and making it hard to handle the TOC.
After you guys clone or download this repo and run npm build to get the ouput. Here's a DIY way to add the PIN list toggle button to the spec.
It's all about modifying two files: out/ecmarkup.js out/ecmarkup.css
In the out/ecmarkup.js, just add these code to the end of it:
//----------------------------------------------------------------------------------//add toggle icon to the menuwindow.onload=function(){varMenuPins=document.getElementById('menu-pins');varMenuPaneHeader=MenuPins.querySelectorAll('.menu-pane-header')[0];varMenuPaneHeaderToggle=document.createElement('span');varMenuPaneHeaderToggleIcon=document.createTextNode('◢');MenuPaneHeaderToggle.appendChild(MenuPaneHeaderToggleIcon);MenuPaneHeaderToggle.setAttribute('class','MenuPinsNormal MenuPinsNormalCollpase');MenuPaneHeaderToggle.setAttribute('id','MenuPaneHeaderToggle');MenuPaneHeaderToggle.onclick=MenuPinsToggle;//add event that toggles the pin listMenuPaneHeader.appendChild(MenuPaneHeaderToggle);};//toggle the MenuPinsList functionMenuPinsToggle(){varMenuPinsList=document.getElementById('menu-pins-list');varMenuPaneHeaderToggle=document.getElementById('MenuPaneHeaderToggle');if(MenuPinsList.style.display==='none'){MenuPinsList.style.display='block';MenuPaneHeaderToggle.setAttribute('class','MenuPinsNormal MenuPinsNormalCollpase');}else{MenuPinsList.style.display='none';MenuPaneHeaderToggle.setAttribute('class','MenuPinsNormal');}}
And in the out/ecmarkup.css, add these to the end of it:
It has flaws. The solution mentioned before only solves this problem on PC. How it may look on the mobile device has not been tested. So a thorough test is necessary. And to your invitation, the answer is yes, of course.
@ljharb I have been running a few tests and make sure that all the media rules get considered. It seems fine to me now. Then replace element.css in the ecmarkup/css/ and menu.js in the ecmarkup/js/ directory with the updated files, run npm run build after that. The ouput works well.
@ljharb It can be done, just need to add a file 'pinCollpase.js' to replace the two files with our updated files and change the build script in the package.json into "build": "node pinCollapse.js && npm run build-master"
Activity
peterzhangsnail commentedon Mar 16, 2020
After you guys clone or download this repo and run
npm build
to get the ouput. Here's a DIY way to add the PIN list toggle button to the spec.It's all about modifying two files:
out/ecmarkup.js
out/ecmarkup.css
In the
out/ecmarkup.js
, just add these code to the end of it:And in the
out/ecmarkup.css
, add these to the end of it:Then you will get your collapsable DIY PIN list.


ljharb commentedon Mar 16, 2020
@peterzhangsnail would you be interested in making a PR to https://github.com/bterlson/ecmarkup to add that functionality?
peterzhangsnail commentedon Mar 16, 2020
It has flaws. The solution mentioned before only solves this problem on PC. How it may look on the mobile device has not been tested. So a thorough test is necessary. And to your invitation, the answer is yes, of course.
peterzhangsnail commentedon Mar 16, 2020
@ljharb I have been running a few tests and make sure that all the media rules get considered. It seems fine to me now. Then replace
element.css
in theecmarkup/css/
andmenu.js
in theecmarkup/js/
directory with the updated files, runnpm run build
after that. The ouput works well.ljharb commentedon Mar 16, 2020
If that could be done in ecmarkup itself, rather than just in this repo, that would be ideal.
peterzhangsnail commentedon Mar 16, 2020
@ljharb It can be done, just need to add a file 'pinCollpase.js' to replace the two files with our updated files and change the build script in the
package.json
into"build": "node pinCollapse.js && npm run build-master"
peterzhangsnail commentedon Mar 16, 2020
@ljharb Here's the
pinCollapse.js
, just make it so,bro.(Of course, use it after double check)pinCollapse.zip
ljharb commentedon Mar 17, 2020
Any chance you could make a PR to ecmarkup for that?
peterzhangsnail commentedon Mar 17, 2020
@ljharb Launch a pull request there, just waiting for the owner's test and merge.