Force GitHub pages to render numerical lists sequentially instead of restarting? - github

I noticed that when GitHub pages with mkdocs have text or images in between numbers it ignores the numbering in the source document and instead restarts numbering. See here for an example of this.
Is there a way to force mkdocs to render the numbers in the original document instead of inventing its own?

If you add them all as 1. space and text, then sub item as image with a tab, it should work. As an example:
1. Option 1
imgage or next text
1. Option 2
You can check this documentation built using mkdocs as an example.

As Zoran mentioned above that was part of it. Things I figured out:
Code must be double tabbed - you cannot use ```
Indented lists must also be double tabbed - I wasn't able to get a single tab to work
Images do not have to be tabbed - they can be in line with the above text
There should not be an empty line when an image follows a numbered list item BUT FOR CODE there must.
I still haven't completely figured out. mkdoc's behavior is not as predictable as regular markdown

Related

VS Code : Format document is working weird on Flutter

When i click "Format Document" button inside of page, it looks like this,
From what I can tell, you are trying to solve the awkward line wrapping and deep nesting problem. When your code gets nested as deep as it is, it hits the column word wrap limit and the limit forces forces the formatter to break items that would normally be on one line into several. There are a couple things you can do:
Best option: Refactor your code and split it into multiple classes/ files. That will make it so that you don't have as deeply nested code and it will make it more readable as well as more maintainable.
Go to the vs code settings and search for Dart: Line Length and edit the value to set when the file starts wrapping content.

Creating a textual copy of the apl language bar

I would like to embed a picture of the Dyalog APL language bar into text and PowerPoint material. How can I do that? It would be nice to be able to select and paste it.
Embed a picture - you mean this?
I would:
ALT-CTRL-PrtScn to get the bitmap image of the window in focus, then
Paste into MS-Paint, then crop off all but the wanted part, as I did here.
Alternately, some products, notably Word and Outlook, have the ability to crop the picture in-situ once you've pasted it.
Possibly PowerPoint has this feature as well.
This page has a text-based language bar you can select, copy and paste the characters from. Just note that it includes two more characters (∆⍙) at the end, not found in Dyalog's IDEs.
These are the characters on Dyalog's language bars:
← +-×÷*⍟⌹○!? |⌈⌊⊥⊤⊣⊢ =≠≤<>≥≡≢ ∨∧⍲⍱ ↑↓⊂⊃⊆⌷⍋⍒ ⍳⍸∊⍷∪∩~ /\⌿⍀ ,⍪⍴⌽⊖⍉ ¨⍨⍣.∘⍤⍥# ⍞⎕⍠⌸⌺⌶⍎⍕ ⋄⍝→⍵⍺∇& ¯⍬
Here's a way to get the actual language bar content. Just note that the solution is fundamentally fragile: Dyalog might change the way the language bar is configured, and the I-beams may be removed or changed. In particular, 4070⌶ is undocumented and thus unsupported, and might change or disappear without notice.
file←(739⌶0),'\elements.reg' ⍝ file name in temporary directory
{}⎕CMD'reg export "',(⊃4070⌶0),'\LanguageBar\Elements" "',file,'" /y' ⍝ export registry key
⊃¨0⎕JSON¨'"av char"=(.*)'⎕S'\1'⊃⎕NGET file ⍝ extract data stings and evaluate escapes
On my machine, this results in:
← +-×÷*⍟⌹○!? |⌈⌊⊥⊤⊣⊢ =≠≤<>≥≡≢ ∨∧⍲⍱ ↑↓⊂⊃⊆⌷⍋⍒ ⍳⍸∊⍷∪∩~ /\⌿⍀ ,⍪⍴⌽⊖⍉ ¨⍨⍣.∘⍤⍥# ⍞⎕⍠⌸⌺⌶⍎⍕ ⋄⍝→⍵⍺∇& ¯⍬

indeneted files in my sublime don't show up indented correctly on github files

I have indented my files in my sublime text but when I push to github they don't look indented. How do I fix this?
The approach taken to indent file on sublime is:
select the code > Edit > Line > Reindent
looks like this on github:
Your issue looks to be caused by your use of literal tab characters for indenting as opposed to using spaces instead.
If there's a hotter holy war topic among developers than the debate of tabs versus spaces, it's probably related to how wide you should interpret a tab character to be for display purposes if you happen to use them.
In particular your images would appear to indicate that you think that tabs should be 2 characters wide and GitHub thinks they should be 8. As mentioned in this answer you can append an extra query field to the URL in GitHub in order to view the files the way you prefer them to be viewed.
As far as I'm aware that just changes how they're rendered on the page when you view and doesn't actually modify the file at all. If it's important that the file retain the same indent levels regardless of where or how you view the file, you should convert from tab indentation to space indentation instead since a space is unambiguously sized.
If you're using Sublime Text you can do that by clicking in the status bar where it says Tab Size: 2 and select Convert indentation to spaces; the status bar will switch to say Spaces: 2 to indicate that the indent has changed.

How to remove extra line space on GitHub markdown bullets/lists?

The GitHub markdown code:
1. First item
* subitem
1. Second item
Generates a big space between the First, Second and the subitem:
How to make the subitem close to the first item, instead of exactly on the middle of them?
This is a Photoshop I did to illustrate the correct output:
Related questions:
Multi paragraph list items, OR preventing numbered list auto formatting
Markdown: Problems with numbered list paragraphs containing code element
You need to indent the sublist with at least 4 spaces:
1. First item
* subitem
2. Second item
You cannot do this going from a primary to secondary item. It is possible from a secondary to tertiary list, however. This is due to GitHub's styling of the markdown, not an inherent issue with the markdown itself.
See this document for details on what is possible regarding different layout styles.
An admittably "hacky" but still working solution:
Choose any character from here.
Copy it and paste it as bullet point:
1. First item [< two spaces for the linebreak]
◦ subitem1 [< two spaces for the linebreak]
◦ subitem2
2. Second item
Don't forget the two spaces for the linebreak.

Eclipse-RCP: Hide lines of text permanently, keep correct line numbers

I have text files which contain code inside an Editor. The user can run an analysis on a certain part of his code, which will result in a set of lines which should be hidden. Next I want to present the user with only the remaining lines, but with correct linenumbers, as from the original document. Possible solutions I thought of:
Open a new Editor which does not contain the hidden lines, but *somehow* still has correct line numbers
Hide the lines in the original editor, and offer a button for the user to 'unhide'. Probably a similar solution required as in 1.
I don't really know how to go about this. Folds would be a weird solution, because they can be unfolded individually, and seem to be more semantically tied to things like methods or classes. Also, simply creating a new document without the hidden lines results in wrong linenumbers.
Use a ProjectionViewer and reflection to invoke the private method ProjectionViewer.collapse(int offset int length). This method is only used internally to hide a certain portion of the text, by manipulating the ProjectionDocument (see http://eclipse.org/articles/Article-Folding-in-Eclipse-Text-Editors/folding.html).
After this, folding text in the editor using the annotations(the little +/- icons) WILL break everything, so this solution and regular folding are mutually exclusive.