Docfx PlantUml Metadata - api

Is there a sample code for using PlantUml in metadata(Api documentation) Docfx?
it is like this image
For example, the following picture is another place that's means article menu no on metadat

It resolved with wrap markdown in a XML CDATA block in the .CS file
CDATA
///<summary>
///<![CDATA[
///```plantuml
///interface IAnimal {
///Name : string
///}
///```
///]]>
///</summary>

Related

How can I Map from XML HREF+Text to Word Document Hyperlink?

I Have a simple XML file e.g.:
<root>
<some_link_href>http://www.microsoft.com/</some_link_href>
<some_link_text>goto microsoft site</some_link_text>
</root>
I have setup XmlMapping, but I can't seem to get a Hyperlink.
I tried using richTextControl and and providing RTF text
(e.g. '{\rtf1\pc some \b BOLD \b0 text}') but it just shown the raw RTF.
Note: even though I'd like to have a Text with HREF, I can settle for clickable URI
Is there any other control? other good methods to use?
also posted # https://learn.microsoft.com/en-us/answers/questions/720964/place-link-on-winword-from-xmlmapping.html

How to validate xml:lang ATTLIST inside XML with DTD?

Many articles on the internet (like this one) suggest using xml:lang or some custom attribute to encode meta-information about language inside XML tags. They mention that these codes have to comply with BCP47 standard.
Let's see what would happen if I encode language attribute as articles suggest:
Inside DTD: <!ATTLIST text xml:lang NMTOKEN #IMPLIED>
Inside XML: <text xml:lang="YODU991Yklew-e-ijsw02ijwk">...</text>
What is the expected result?
DTD validator would check if YODU991Yklew-e-ijsw02ijwk code is a real BCP47 language code, if country and script exist and mark it red, if those codes that are incorrect. Exactly the same way as http://schneegans.de/ helps validating these codes (WRONG code vs. CORRECT code).
What happens instead?
Validator percieves this attribute only as some text and does not validate, if it as a real language code or some gibberish.

create sitecore item as pdf

Hi i am doing kind of migrating other cms to sitecore now.
So my requirement is to viewing pdf in the respective url..
Existing site url : DOMAIN.COM/pressrelease/one
And this will show PDF content in a browser.
New site expected Url: NEWDOMAIN.COM/pressrelease/one
Similarly on my sitecore content i try to create under root one pressrelease item and its child is one.pdf. But i cant able to view my pdf after this when i gave url like NEWDOMAIN.COM/pressrelease/one.
And need expected behaviour is to open a pdf file in a browser as like media (/-/media/pressrelease/one)items are can able to view.
Create AllowedExtensions.config in App_config/include folder(if it does not exist already) and add the following sitecore configuration.The configuration makes sure that pdfs are allowed via URL.
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<preprocessRequest>
<processor type="Sitecore.Pipelines.PreprocessRequest.FilterUrlExtensions, Sitecore.Kernel">
<param desc="Allowed extensions (comma separated)">aspx, ashx, asmx, xml, txt,pdf,png</param>
<param desc="Blocked extensions (comma separated)">*</param>
<param desc="Blocked extensions that stream files (comma separated)">*</param>
<param desc="Blocked extensions that do not stream files (comma separated)"/>
</processor>
</preprocessRequest>
</pipelines>
</sitecore>
</configuration>
I have solved my case using below solution
First i have created one content item NEWDOMAIN.COM/pressrelease/one.
This item having two fields from my template, like shown below.
Then i have some separate Layout file for this content item, In the Layout i have created the code for displaying pdf.(Also in some Layouts i can able to download file too using this approach.)
if(mediaResult.mediaItem != null)
{
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = mediaResult.mediaItem.MimeType;
HttpContext.Current.Response.AppendHeader("Content-Disposition", string.Format("inline;filename=\"{0}\"", mediaResult.mediaName));
HttpContext.Current.Response.StatusCode = (int)HttpStatusCode.OK;
HttpContext.Current.Response.BufferOutput = true;
// Copy the media stream to the response output stream
mediaResult.mediaItem.GetMediaStream().CopyTo(HttpContext.Current.Response.OutputStream);
// As momma always said: Always remember to flush
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();
}

Edit XML tag by attribute

I have a XML document which looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
<Data key="dailyKey">19283</Data>
</Configuration>
And in my vb.net program I want to change the value from "<Data>" by the attribute "dailyKey"
I have tried to understand myself on this but cannot figure out how to edit TAG by ATTRIBUTE
Please help, Richard
You could use XPath expressions and the SelectSingleNode method like this:
Dim node = xmlDoc.SelectSingleNode("//data[#key=""dailyKey""]")
Then you can modify the value of node as you wish to. You can find more XPath examples at MSDN.
The workflow in its entirety would be:
1. Load the XML Document for manipulation
You can use the XmlDocument class to load (and subsequently save) your XML Document like this:
Dim xmlDoc As New XmlDocument()
xmlDoc.Load("<Here goes your url // You can also feed in a stream to this method>")
2. Locate the node you want to modify
As mentioned earlier, use the SelectSingleNode function to locate the node you are trying to modify the value of. It takes an XPath expression.
Dim node = xmlDoc.SelectSingleNode("//data[#key=""dailyKey""]")
3. Modify the node
You can now edit the node (tag) in whatever way you wish. It seems you want to edit the contained value. Do it by changing the Value property of the XmlNode:
node.Value = 224062 'Random value. Change to suit your needs.
4. Save the XML Document (Obviously :P)
xmlDoc.Save()

Doxygen: Empty Detail Description

Context - Doxygen tool on C codes to generated RTF documents.
In the documentation of Modules/Groups, we are getting the header "Detailed Description" even if no detail description is provided for some particular module/group.
In generated RTF document this looks ugly. Is it possible to get rid of this empty Detail Description sections?
I tried "ALWAYS_DETAILED_SEC = NO" but it is not working. I cannot do "HIDE_UNDOC_MEMBERS = YES" as the group/module contains members (struct, functions ...) which are documented.
This may be a bit late, however others may be interested (I was).
You can remove the group detailed description completely using the layout file, though if you have a brief description a More... link will still be created (which links to nothing). My solution was the disable brief description for groups and move detailed description to the top of the page (essentially replacing it).
Create a layout file by running the following command dOxygen -l. The creates the default layout file. The section we are interested in is groups, near the bottom:
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
Now set visible="yes" to visible="no" in the briefdescription field. Near the bottom of the file you will see a <detaileddescription title=""/> Move this to the top, above or below briefdescription. You should now have:
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="no"/>
<detaileddescription title="Description"/>
<groupgraph visible="$GROUP_GRAPHS"/>
Note that I've changed the title to "Description" by filling in the title field. Save the file. Now in your Doxyfile, you need to specify a custom layoutfile. Add the following line (or search for it and fill it in):
LAYOUT_FILE=DoxygenLayout.xml
Assuming your paths are correct etc, you should now have group pages with brief description replaced with the full description.
The reason as to why "Detailed Description" gets generated even if there is no Documentation in the Entities (Modules/Groups, etc..) is because the Doxyfile tag EXTRACT_ALL is set to YES.
By Setting,
EXTRACT_ALL = NO
ALWAYS_DETAILED_SEC = NO
Only the entities documented with Doxygen special comments will get Documented. And only those entities having #details -> Detailed description will be listed under the Detailed Description section.
Unfortunately it doesn't generate if the class has been documented like:
/// <summary>
/// This is..
/// </summary>
class ABC
{
}
remove the 'summary' tags, i.e. it should be like
///
/// This is..
///
class ABC
{
}
search for detailed description(at the begining) in the link below
http://www.star.bnl.gov/public/comp/sofi/doxygen/docblocks.html