Visual Studio XML Schema annotations (vs:htmlequivalent) - javascript

I'm creating an xml schema for a document that will eventually be translated into javascript. It would be really useful to allow the insertion of custom js scripts right within the document. This isn't hard to accomplish (a node can just contain text, that will be the javascript), but what is difficult is to get Visual Studio to give JS Intellisenseinside the tag instead of xml Intellisense.
If found this article that describes htmlequivalent annotation that says you can tell the xml editor to treat a tag as the equivalent HTML tag (in this case the script tag, and this is even the example given). But my attempts at using it have failed. Does anybody have any ideas on how to use this? There is very little documentation on msdn about this annotation and about the same on google/bing.
The MSDN article regarding the annotation: http://msdn.microsoft.com/en-us/library/aa713989(v=VS.71).aspx

Unfortunately there's no documentation available for newer XML Schema annotations - the one on MSDN is for VS2003. Your best bet is to check out the already available XML Schemas in the folder:
[VSInstallFolder]\Common7\Packages\schemas\html\
The HTML5 one should give you a good overview of the available features. There are even more features in XML Schemas in WebMatrix 3 beta, like supplemental Schemas, but they are still not available in VS.
However I'm not sure that the functionality you're trying to achieve is possible.

Related

How do you document a React Native/React/Node project within the team?

I would like to learn of ways that yourself or your team handles documentations within your JS-related projects, such as React, React Native, or Node. This includes custom hooks, API methods, usage guides, helper function usage or any other functional methods that requires a documentation to understand; that gives future code maintainers a common guide to understand the methods, without having to read the individual method codes.
I do have a few ways in mind:
Using .txt files within the JS project folders to note down example usage
Having a common text document stored somewhere within Google Docs, Word or related platforms
Having a TypeScript related documentation system
Does anyone have any such practices within your team, and how is it working out?
You can create markdown(.md) files inside the project depending upon your choice. It is obvious that you will be having different folders and subfolders inside your project. You can create markdown files inside every folder to describe the functions, features and their usage. In this way, you can keep the documentation close to the files containing the described functions.
Using markdown, you can explain the functions, logic, folder structure, etc, very nicely and add some usage code snippets, external links, images, etc in your description.
While working with the team, you might also be using some version control system like GitHub, BitBucket, GitLab, etc. When you will create the markdown files with the special name “README.md”, then these version control systems will display these README files automatically when you will open(navigate through) the particular folder on their websites.
You can make use of the tools like:
https://readme.so/editor (My favourite)
https://www.makeareadme.com/
to create the readme files very easily while getting the output of the markdown immidiately on the right panel.
Learning markdown is also very easy. There are very few basic things you are required to learn and the rest is upto you and how you use them. For example:
use # for adding headings
use - or * for adding list item
enclose the word or sentence inside back-ticks(`) to highlight them
to display the code block, enclose the code inside the pair of three back-ticks
use []() for adding link
If you are looking for an advance tool, then https://docusaurus.io/ can be an awesome choice to focus only on your content and let the library take care of making easy to read documentation website for you.

Advansed xlsx spreadsheet formatting

Is there some JavaScript or Golang lib that allows to create xlsx files using some custom heavy formatting?
I'm working on an Electron app and want to generate some reports but
the most popular library doesn't provide cell formatting, that fork looses the ability to define page properties like margins and page orientation and that Golang lib as I see doesn't provide page properties too.
Can anybody show some good alternatives or show me I'm wrong?
(no C-like langs and Python please)
I am myself looking for something similar to format docx documents and I have just started trying out gooxml.
Currently it has following capabilities for Excel:
Read/Write/Edit
Cell formatting including conditional formatting
Cell validation (drop down combobox, rules, etc.)
Retrieve cell values as formatted by Excel (e.g. retrieve a date or number as displayed in Excel)
Formula Evaluation (100+ functions supported currently, more will be added as required)
Embedded Images
All chart types
Edit to answer comment:
As stated in the documentation, you may have to fall back to raw document manipulation should the library's API not cover a specific use case.
See CT_PageMargins.go and CT_PageSetup.go for margin and orientation...
Well it seems I've learned the lesson - after trying to use "super-hard-to-understand-and-use" jsreport-xlsx module I've remembered about one lib that didn't worked in Electron renderer and tried it to work from Electron main process.
And it works! Sometime it may be a little treaky to make it create doc exactly you want but it's much better than XLSX-style I've used before and have all features I want.
(it's second [and last I believe] time I've forget about Electron renderer is not Node.js, the true Node.js is main process)

Machine readable HTML and CSS spec?

is there a XML or JSON resource I can parse in Javascript that tells me what HTML elements there are, what their attributes are and what CSS styles I can apply? I want to have a list of valid options without typing in everything by hand.
Please bear with me here, I'm new to this web stuff but have plenty experience in C (mostly game engines).
TIA!
(X)HTML before version 5 have DTDs that you can parse (you can get the URLs for them from the Doctype for the version of (X)HTML you are working with.
HTML 5 doesn't have an official machine readable spec. You might be able to extract something useful from the validator.nu source code though.
The CSS properties that can be applied to an element depend only on what other CSS properties have bee applied to it. Their only connection to HTML is that the browser's default stylesheet applies some properties automatically.
Sorry that this answer is almost six years too late for you. I was looking for the same thing and ended up writing my own tool for extracting some of the specs from the standard and exporting it as JSON
https://github.com/tawesoft/html5spec (self promotion disclaimer: I made this)
Hope that helps someone

Which comments documentation format is better for JavaScript?

Is there are any comments documentation format for JavaScript and processor for this format which generates HTML documentation?
Currently I am using VSDoc xml comments for providing IntelliSense help at developing time, but as I know there is no documentation generator for such comments.
So alternatively my question may sounds like: Is there are any utility which translates VSDoc comments from JavaScript files to HTML?
Have you looked at auto generated documentation from JavaDoc or VSDoc or JSDoc or anything like that.
They are all ugly and un-readable.
The solution is two fold
annotate your code with docco
Make your API documentation hand written.
There is a third option which is to revolutionize the way we do auto generated documentation, if you can then please do.
I've used Natural Docs for a few projects. The syntax is nice for reading the inline, but since it doesn't have "full language support" for JavaScript, you have to be somewhat explicit about each function/constant/class/whatever you want to document.
There is a utility that parses Javascript files and outputs the same XML format NDoc and Sandcastle use: AjaxDoc
That way you get the VS intellisense from the same comments and can output any format that you want.

Tool for showing javascript, CSS, HTML dependencies

I am relatively new to JavaScript and trying to find a way to get a good overall understanding of JavaScript projects, frameworks, etc.. For example when I look at a JavaScript based source on Github I would like a one page snapshot of the dependencies between the html, css and the various .js files requiring further js files( modules) , instead of looking at the source code tree and opening up the individual files. What I am looking for is either an object diagramming tool or something like a "file diagram".
Is there a tool out in the wild already doing this? (and ,yes I have already tried Google-ing it)
(I used to use a tool in the Windows world for tracking DLLs which is a similar concept.)
https://github.com/nodejitsu/require-analyzer gets you part of the way there.
One could also implement a file dependency analyzer if you are looking for more comprehensive html/template analysis with these two:
http://nodejs.org/docs/v0.4.8/api/fs.html#fs.readdir
http://nodejs.org/docs/v0.4.8/api/fs.html#fs.watchFile
Using Firebug you can see the files requested by each page, the server response and you can filter them by type. The HTML view lets you see the entire page including related js/css content. I don't think it's exactly what you are looking for, but I find it helpful for this sort of thing.
here are some bookmarklet code that could help (taken from https://www.squarefree.com/bookmarklets/webdevel.html
view style sheet :
javascript:s=document.getElementsByTagName('STYLE');%20ex=document.getElementsByTagName('LINK');%20d=window.open().document;%20/set%20base%20href/d.open();d.close();%20b=d.body;%20function%20trim(s){return%20s.replace(/^\s*\n/,%20'').replace(/\s*$/,%20'');%20};%20function%20iff(a,b,c){return%20b?a+b+c:'';}function%20add(h){b.appendChild(h);}%20function%20makeTag(t){return%20d.createElement(t);}%20function%20makeText(tag,text){t=makeTag(tag);t.appendChild(d.createTextNode(text));%20return%20t;}%20add(makeText('style',%20'iframe{width:100%;height:18em;border:1px%20solid;'));%20add(makeText('h3',%20d.title='Style%20sheets%20in%20'%20+%20location.href));%20for(i=0;%20i
view scripts:
javascript:s=document.getElementsByTagName('SCRIPT');%20d=window.open().document;%20/140681/d.open();d.close();%20b=d.body;%20function%20trim(s){return%20s.replace(/^\s*\n/,%20'').replace(/\s*$/,%20'');%20};%20function%20add(h){b.appendChild(h);}%20function%20makeTag(t){return%20d.createElement(t);}%20function%20makeText(tag,text){t=makeTag(tag);t.appendChild(d.createTextNode(text));%20return%20t;}%20add(makeText('style',%20'iframe{width:100%;height:18em;border:1px%20solid;'));%20add(makeText('h3',%20d.title='Scripts%20in%20'%20+%20location.href));%20for(i=0;%20i

Categories

Resources