can't insert tables within dd tags in markdown syntax - html

setting up documentation for a plugin.
Can you add tables within a dd tag?
I tried the code below but it wont output as a table I tried with the double space line break technique but nothing either
This doesnt parse the table and just leaves the table syntax as is
Term
: definition
: | Table cell | Table cel | Table cell |
This wont render (note there are two spaces after definition)
Term
: definition
| Table cell | Table cel | Table cell |
my goal is this:
<dl>
<dt>Term</dt>
<dd>
definition
<table>
<!-- table rows and cells here -->
</table>
</dd>
</dl>

Depending on the Markdown implementation you are using either you can't or you need to do three things:
(1) Wrap your table with blank lines
A table is a block level element, just like a paragraph is. Therefore, it needs to be on a line by itself. To accomplish that, you need to include a blank line before the table. There is no need to add two spaces to the preceding line as the blank line already separates the elements and each block-level element will always be on its own line (barring some non-standard CSS which changes that behavior) .
(2) Indent your table
Of course, when you are nesting block level elements inside a list item and those elements do not start in the first line of the list item, you must indent those elements by one level to indicate they are nested. Therefore, the table must be indented by four spaces or one tab.
(3) Add a table header
Except for Kramdown, all implementations which support tables (that I am aware of) require the table to include a header. Otherwise, they do not recognize it as a table.
Example
Try this:
Term
: definition
| Header 1 | Header 2 | Header 3 |
| ---------- | --------- | ---------- |
| Table cell | Table cel | Table cell |
That said, both definition lists and tables are non-standard Markdown and their behavior varies among implementations which support them (not all do). Therefore, YMMV.
In fact, Babelmark demonstrates that the above works for Pandoc, RDiscount, PHP Markdown Extra, and MultiMarkdown (strangely version 5, but not version 6). Note that a few other implementations likely would work as well if they were properly configured. Babelmark only demonstrates default behavior for each implementation.

Related

Recursive tags hierarchy retrieval in sql

(Assumption: each tag may have a parent tag, i.e. there exist a hierarchy of tags, without limiting its depth.)
Is there a way (possibly with just one query) to retrieve all the children tags of a tag with just SQL, i.e. without using a code?
The problem is:
I have a hierarchy of tags:
root-tag
- tag-child -> parent is tag-child
-- tag-child-depth-2 -> parent is tag-child-depth-2
--- tag-child-depth-3 -> parent is root-tag
- tag-other-child -> parent is root-tag
This could be represented in DB this way:
id | tag_name | parent_tag_id
-------------------------------------------------
1 | root-tag | (NULL)
2 | tag-child | 1
I have been only given the top tag ("root-tag"). How to rerieve all the child tags?
Expected result:
All the children tags (except root parent tag).
i.e.:
- tag-child
-- tag-child-depth-2
--- tag-child-depth-3
- tag-other-child
The actual way of represeting the result data is not that important (i.e. this could be a simple list / array), however the most valuable would be a recursive array, maintaining the hierarchy - it's not obligatory though of course.

Inline query for listing all pages from a namespace without any subobjects

I need an inline query that lists all pages from a specific namespace, but without listing subobjects specified on these pages.
Restricting results to a namespace is possible like that:
{{#ask: [[ExampleNamespace:+]] }}
But it lists all subobjects, too.
Workarounds:
Specify a category on these pages (subobjects don’t inherit it) and query for the category instead:
{{#ask: [[ExampleCategory]] }}
Specify a property on these pages (and never on the subobjects) and query for the property (with a wildcard value) instead:
{{#ask: [[ExampleProperty::+]] }}
But both workarounds require editing, which I would like to avoid. Is there a better way to solve this?
Not sure if it's a better way, but it looks like array formats/arrays and their #arraymap and #arrayunique functions are a way to go in order to trim SMW subobject tags and make the DISTINCT operation. Unfortunately, the solution below has a query result limit issue described as well (at least out of what I understand in SMW). In general, it may look like the following, and I will appreciate if someone suggests a nicer solution:
<!-- Fetch all pages from the "Live event" namespace -->
{{#arraydefine: QUERY_RESULT
| {{#ask: [[Live event:+]]
| format = array
| link = none <!-- NOTE: array item link -->
| limit = 10000 <!-- NOTE: limit -->
}}
}}
<!-- Store the mapped result into another array -->
{{#arraydefine: MAPPED_QUERY_RESULT
| {{#arraymap: {{#arrayprint: QUERY_RESULT}}
| ,
| $O <!-- NOTE: array map iterator value -->
| {{#explode: $O <!-- NOTE: explode by hash -->
| #
| 0
}}
}}
| ,
| unique
}}
<!-- Generate links markup -->
{{#arraymap: {{#arrayprint: MAPPED_QUERY_RESULT}}
| ,
| $O
| [[$O]] <!-- NOTE: plain links -->
}}
The notes from the code above:
NOTE: array item link - Not suppressing the links causes the mapper to be more complicated (including parsing HTML <span> tags and class attributes).
NOTE: limit - This is probably the biggest issue here as the number of subobjects affects the query result. SMW by default limits the query results, and the maximum query limit cannot be overridden as far as I know. Having more rows, which count is greater than the limits is, will cause the 'Further limits' link to appear. Actually speaking, I have no idea how to work around it nicely.
NOTE: array map iterator value - {{#arraymap}} seems to replace strings in the simplest way like sed or a simple text editor app do. So $O is used as the iterator value placeholder for the formula parameter trying not to clash with other string tokens.
NOTE: explode by hash - #ask subobject results generate hashed links like PageA#_159c1f213de2fcaf165f2c9c5c56686b. Just getting rid of them. In case you need to strip wiki links, you might also play around with [[ or | (encoded like [<nowiki/>[ and <nowiki>|</nowiki> respectively)
NOTE: plain links - The generated links will have underscores instead of spaces. Unfortunately, [[{{#replace: $O | _ | <nowiki> </nowiki>}}]] didn't work for me -- the underscores are simply consumed for some reason, however this approach is also recommended at the #replace function wiki page.
Some links:
SMW array result format
SMW configuration
SMW further results
#arraymap:
#explode:
#replace:
Help:List the set of unique values for a property (pay attention at the "Limitations and issues" section)

Why does this extra ">" symbol is coming in my html page?

Extra symbol is coming ">", can u find out where is this extra >
symbol
Why this ">" symbol is coming in above ?
HTML
<table>
<tr><td>Hi <%username%>,</td></tr>
<tr><td><b>Greetings from Sunlight IT</b></td></tr>
<tr><td>Earlier you are assigned for a <%keyword%> keyword to get <%OldPosition%> position. Your keyword assigned keyword date was <%oldStartDate%> and Previous target date was <%oldtargetdated%> which you couldn't reach your target position.So once again, I'm assigning <%keyword%> keyword to get <%NewPosition%> position. Newly assigned date is <%NewStartDate%>and target date is <%Newtargetdate%></td></tr>
<tr><td>This time try to achieve the target position i.e <%NewPosition%> for the keyword <%keyword%> with out fail.
</td></tr>
<tr><td>Thanks & Regards</td></tr>
<tr><td>Project Manager</td></tr>
<tr><td>Sunlight IT</td></tr>
<tr><td>My desk | 91 40 5454</td></tr>
<tr><td>t | 91 40 4545</td></tr>
<tr><td>e | support#gdgds.com</td></tr>
<tr><td>w | www.sunlifdfasghtit.com</td></tr>
</table>
</body>
You have <br/> elements in your table, outside of any table cells. That is forbidden by the HTML spec; all content inside a table should be in a table cell.
See the jsfiddle made from your source, and the same with the <br/>s removed.
Edit: the reason why the <br> causes extra space is that the browser doesn't know what to do with them, so it puts them all on top, before the contents of the first <tr> instead of in between the <tr>s where you expected them.
And all browsers handle this in the same way, unlike most other errors I could mention. So it's best not to have errors at all.
Remove all of the <br/> in your table, they're not allowed there.

Designing table definition syntax for Markdown

I have made no secret of my disdain for BBCode and support for more readable text-to-HTML converters like Markdown, which is what SO uses. "Canonical" Markdown however doesn't have a syntax to define tables. So, I am trying to come up with an extension that does just that.
Above all, it should be easy to read and write. Of course it also shouldn't be conflict with existing Markdown syntax. PHP Markdown has syntax for tables that looks like:
| First Header | Second Header |
| ------------- | ------------- |
| Content Cell | Content Cell |
| Content Cell | Content Cell |
For some reason, this strikes me as "not enough enough" (mainly because it looks a little too verbose). Does anyone know of a Markdown dialect with a nicer syntax? You are welcome to write your own as well.
Bonus points if it's not extraordinarily difficult to parse but still flexible enough to handle alignments (horizontal and vertical), table headers and possibly colspan and rowspan.
I like Textile's table syntax. It looks like:
|_. a header cell |_. another header |
|_. one more header |=. centered cell |
| regular cell |>. right-aligned cell |
The parser doesn't care about whitespace. This syntax is flexible and avoids the rigidity of syntaxes (like yours, Reddit's, etc.) requiring a "separator" line between a single header row and the rest of the table.

<table> <table> in Flex Apps

I am learning flex and have written a little app with a TextArea that had data getting populated dynamically by embedding simple HTML (mostly for font styles)
I ran into a weird issue when I wanted to include images, the images in this case are small arrows as in reddit.com. My desired aligmnent is,
-------------
o | foo bar
| ffdfdfdf
| fdfd
-------------
o | dfdd
-------------
Where o in the first column is an image. Note that the borders are invisible.
I just used a simple <Table></table> and works perfectly if I view the resulting HTML in a browser. However flash renders the table in a very screwed manner, I get something like this instead
--------------
o fooooooo
ffffdfdf
fdfd
-------------
o fff
--------------
If the second line has more than one line, the subsequent lines wrap around the first column. Is this a known problem?
Flash's (and hence Flex's) htmlText doesn't officially support tables to begin with.
Use a Datagrid instead.