How to collapse heading in ascii doc file - asciidoc

I have following file as adoc file.
= Template
:toc: left
:toclevels: 5
:sectnums:
:sectnumlevels: 5
== Course1
=== Section 1
This is section 1
=== Section 2
This is section 1
== Course2
=== Section 1
This is section 1
=== Section 2
This is section 1
I have installed asciidoc pluging in my chrome and when I open the file in chrome, it looks like this:
Some of the files are very big, and also the Table of Content has become huge.
Question: Is there a way to click on lets say Course2, and the sections under that would collapse, and expand if I click on it again.
I have tried the following link: How to collapse TOC(table of contents) in spring RestDoc (asciidoc)? and few other resources on internet but not much luck.
Please guide.
Thanks.

The main difference between the RestDoc solution and your current situation is the technique required to load the custom JavaScript.
In the RestDoc solution, the technique is to use docinfo files which get loaded during the execution of asciidoctor. See https://docs.asciidoctor.org/asciidoctor/latest/docinfo/ for more details.
When you use the Asciidoctor.js extension, you have to configure the extension to explicity load the custom javascript. The extension doesn't have access to the filesystem, so it can't look for JavaScript automatically. You have to load custom JavaScript into the extension itself.
Right-click the extension icon in the Chrome button bar, and select "Options". In the "Asciidoctor.js Live Preview" options pane, scroll to the bottom and click "Add a JavaScript...". The JavaScript you add needs to be in a file in your computer's file system. Once added, you can use the radio buttons at the bottom to select when the script runs.
Your browser's developer tools console will show any errors or console.log output from your added JavaScript code, which can be very helpful if there are problems.

This is not a problem with the Syntax itself but with the way you display the file.
If you have huge AsciiDoc files and need a good way to display them I would encourage you to check Antora, it generates a static website out of your AsciiDoc files in a very clear and organized way. You get by default this collapsing table of content on the left, you can check the default look in their documentation.
It changes the way you need to organize your documents and is a bit bit of work for the installation but the result is great.

Related

Collapsible Table of Contents sidebar in Sphinx rtd theme

I am using Sphinx to document my python code, I've opted to use the built in sphinx_rtd_theme (read the docs theme) as shown in
My documentation is purely local, it is in no way connected to the internet, it looks fine except that in the demo the table of contents(sidebar) expands and collapses when you hit the [+] or [-] symbols. Mine does not, actually it does expand on the first click, subsequent clicks open up the path to the index.html folder in windows explorer. Double clicking does the same.
My question is how can I prevent this behaviour and make my table of contents work just as in the demo with a nicely expandable/collapsible TOC.
Is it a setting in the conf.py file?
I did read the docs from the sphinx website which points to themeing options, but they only seem to apply to the classic theme. Am I understanding this correctly?

Possible to include an image in the meta data in code? VS 2013

I would like to be able to include a screenshot of a control inside my code, this way making control identification easier for new members on my team, is such a thing possible?
Maybe even the ability to just have the image on a network share with the path in a comment, and then have a plugin that when hovering over the link brings up the image?
EDIT (More detail):
I'm creating a test project, the application under test has over 1000 controls, some of them are similar in name and purpose, this can make it difficult at times for developers to reuse the API I am creating because the control name is simply not enough for quick identification of the control in use.
I use the word API very loosely too, none of this stuff will be consumed in web services, and it will always be white box with developers including a project reference and have direct access to the source code.
For every form in my application (The test one), I have a controls.cs file where all the controls for that form in the application under test are listed - This is where I want the hover to screenshot ability in the control definitions.
Another sure factor is that all developers will be using VS2013 (For now the base version), later this could be update 1 or 2.
As the initial author and senior developer on this project, these hover / image references (in the code) will be as useful to me personally as any 3rd party developers, or any later developers to join the initiative.
Thanks again, and I added a bounty!
I believe you can use Whole Tomato's free SourceLinks Visual Studio extension to do what you want - or at least get pretty close to it.
Built-in Functionality:
Out of the box, the extension allows you to specify comment patterns you want users to be able to take an action on. Once the patterns are specified, SourceLinks will highlight any occurrences of those patterns in the text editor. You will be able to double click the highlighted items and perform a pre-configured action (such as opening a link in an internal/external browser, or launching an executable).
You can see an example in the SourceLinks configuration dialog shown below:
(source: wholetomato.com)
So you could use this feature pretty painlessly to define a keyword such as Control Image and then put comments like the following in your code:
// Control Image: my_smart_list.jpg
SourceLinks would allow you double click this text, and you could have that configured to launch the image (using a file:// or http:// url depending on how and where your images are stored) either inside Visual Studio in it's internal browser, or in an external browser.
Custom Tooltips!
Now, if you want to put in some more effort into this and actually write some code, then SourceLinks allows you to create API Extensions to display custom tooltips when the user hovers over the marked text in the editor. The default installation of SourceLinks comes with sample API extensions that you can copy to create your own. See the article linked at the very top of the answer for more details on these samples.
This post in the SourceLinks forum informs us that SourceLinks expects the custom API Extension to return the tooltip value as FlowDocument XAML text. This is awesome news for us, because a FlowDocument can contain many types of elements, including formatted text, hyperlinks, and images.
Imanges in a Flow document can be specified both inline as well as externally.
Hope this helps!
I would use doxygen -- create the images somewhere in the source tree and use doxygen comments. You can embed the \image command in source comments (see docs) and doxygen will generate all the HTML documentation from there. I think doxygen is a great tool for documenting a codebase as you can generate the documentation directly from comments in the source and distribute or host the HTML separately.

Content and footer of magento front end is not displaying except header

My front end of magento does not show any content and footer, its only showing header and navigation menu. I have checked in view.phtml as the code is there to display the page. please provide me the solution.. picking my hair since morning...
If I understand you correctly, your site is loading the header and then displaying nothing after that section. Syntax errors in PHP are the most common cause of this. Could be something as simple as whitespace. In order to diagnose I would recommend turning on template hints in Magento's backend to see what template files have or have not loaded.
From the dashboard, go to System > Configuration. Scroll down to the bottom left and you will see "Advanced". Click on "Developer" underneath that. A new screen will appear. Click on the section labeled "Debug" and uncheck "Use Website" next to "Template Path Hints". If you don't see this option, switch stores in the upper-left drop down.
Go back to your troubled web page and reload. You'll see all kinds of fun markup which leads to file paths pertaining to your site. After header.phtml loads, usually the next files to be called are breadcrumbs.phtml, topmenu.phtml or even homepage.phtml depending on your site's setup. I generally go into these template files, select all and delete the contents of each. If breadcrumbs.phtml is empty and your content isn't showing, restore it with cmd + z or ctrl + z and move on to the next file. Empty it, save it and reload the website. The goal is to narrow down that syntax error that is causing the page to break. When you have successfully found the file, your site will load correctly (minus whatever phtml file you just emptied). Be sure to have a backup or copy of your PHTML files while doing this. ;)
You could also switch back to your default template. If your content returns then you definitely know it is something with your custom template.
You might also be able to check your PHP/Apache logs for signs of trouble but I feel confident the above method will help you out. Let me know.

Content of article not showing

I have a menu item that links to an article, I have the menu item shown in the page, but then the user clicks onto the link, it will only show the title of the article but not the content. I am not sure, what exactly is happening.
I checked the source of html, nope the content isnot there. although the content is there in the database. I ran the degbug mode, but it will give the correct article, only it wouldnt render the content.
One of the menu which was there from beginning acts as required but if I add any menuitems and article, I wont see the content.
I had this problem, this is what solved it (using Joomla 3.2):
Clicked Extensions -> Template Manager to go to 'Template Manager: Styles'
Clicked on the style being used by the pages that did not show content, for me 'yoo_master - Default'
Under the profiles Tab, in the Content section I changed 'System Output' to 'Yes'
Then page content started showing again.
If you have the Agressive cache enabled (Global Configuration > System) and the Cache plugin activated it might take a while before any changes will appear. Flush the cache (Maintainance > Clear Cache), and see if the content shows after that. Also some Template Frameworks (like T3) have their own cache layer which might prevent your content from showing up.
Otherwise there could be a problem in the template, rule that out by assigning the default Template.

How do I edit the actual content of this TYPO3 plugin object?

I've inherited a site using TYPO3 and I don't have that much experience with it. I have a page with a left column in the layout. In that left column is an object using an "insert" plugin. On the actual page is a graphic map. I'm just wondering how to edit the actual content that this is referring to. Here is a screenshot:
Here it is a bit more zoomed in...
Based on all of the meta-data this is some kind of "Magento"/"Insert" plugin being used. Again, the question is, where do I edit/change the actual content associated with this object?
If I click on the plugin icon to the left of the "Magento Left" label and select "edit", this is what I get:
Clicking the "Plugin" tab gives me this:
HELP!
My guess (and it is a guess, since I've never used Magento before) is that you can't, at least not through the TYPO3 backend. The Magento plugin is probably creating the output itself and then piping it into the plugin directly. So to alter the output you'd need to go into the Magento plugin's source code and edit that.
I have also not used this particular extension, but you might have success in clicking the plugin icon just to the left of the "Magento Left" title. At any rate, if this is the plugin called "Magento", it seems to be simply a bridge for content from somewhere else, and the displayed content should then probably be edited somewhere else. All speculation here. Further info about the plugin might be obtained from
http://typo3.org/extensions/repository/view/fb_magento/current/.

Resources