I tried using http://www.plantuml.com/plantuml/proxy?cache=no&src=file.txt, where file.txt is source of plantuml diagram inside my project. I wanted to use this url as parameter for link inside markdown file as uml http://www.plantuml.com/plantuml/proxy?cache=no&src=file.txt, to have diagram shown in markdown file. But it works only for public text files, and I would like to have that file.txt inside my private project where markdown file with proxy url would be as well, is there a solution for private projects?
Related
I want to add some translations to my Blazor web application. Upon research I found a great way to do this is using IStringLocalizer like described here.
However I find it hard to manually create the *.resx files. I mean every class has a localizer instance via
#inject Microsoft.Extensions.Localization.IStringLocalizer<MyPage> _localizer
and text is translated like this
#_localizer["This is a translated text."]
Now is there a way to execute a command in Developer Command Prompt with a given language in order to automatically create translation files for all localizer instances, so files like Resources\MyPage.en.resx and Resources\MyPage.de.resx and so on are created and can be translated?
I have a solution that is on TFS. I'm trying to add a WSDL as service reference to it.
The WSDL's URL looks like this: ".../ws/soap;auth=..."
When adding the reference, VS will generate all the required xsd files and the xsd files name would use the URL as its name. When generating it, TFS will try to automatically add the files, and at this point it will detect that I have a .xsd files with illegal character ";" as its name and then the whole service reference generation just failed and stopped.
I have tried adding the wsdl to a solution that is not bound to TFS and it works just fine.
Any workaround? How do I add the wsdl as service reference to my solution if the generated xsd contains illegal character that TFS won't accept?
You can use svcutil to generate proxy classes,svcutil is a .NET tool that retrieves metadata from a web service on a network location or from a WSDL file, and generates a WCF class containing client proxy methods that access the web service operations.
You can use this tool on the command-line interface of VS:
enter image description here
Executing the above command will generate the a proxy class and configuration file on disk D.Then add these two files to your project:
enter image description here
Here's a link about svcutil:
https://learn.microsoft.com/en-us/dotnet/core/additional-tools/dotnet-svcutil-guide?tabs=dotnetsvcutil2x
Can you try adding a new class to your project, and copy the contents from the generated proxy class file through svcutil (link below, just in case). This way, I believe, you would be able to bypass the illegal characters in XSD.
You would be able to generate proxy class through Visual Studio Command Prompt using SvcUtil command
HTH!
I have a gradle project with a gradle.properties file. One of the properties displays the current version of my project and I would like to include this proprerty in the project's README.md on github. How can I do this?
The Gradle Copy task is capable of such functionality. Simply use its expand method to specify the values to insert. Of course you'll need to define a template somewhere in your project:
task copy(type: Copy) {
from 'src/templates'
into "$buildDir"
include 'projectinfo.html.template'
rename { file -> 'projectinfo.html' }
expand(project: project, title: 'ProjectInfo', generated: new Date())
}
I took this example from a post of Mr. Hakis Blog.
This functionality is based on the Groovy SimpleTemplateEngine. Of course you can simply use this class or any other templating engine to implement the required functionality in your build script on your own.
#KrispyK,
I believe this would be possible. You could write a simple serverless script using webtask (or similar service) that reads your gradle properties file and creates a custom status badge using a badge service like shields.io. Finally, you would only need to add this badge to your markdown file.
Please refer to this webtask script that I created. This calls an external API and uses the data returned by that API to create a custom Shields badge.
I've then used this badge in my readme file.
Hope this helps.
Form inside an ApiController. I need to read content of a file embedded inside the project. But I can't resolve the correct path
[HttpPost]
public HttpResponseMessage DoSomething()
{
String content = System.IO.File.ReadAllText(#"~\SomeFolder\file.txt");
}
Doing like this the resolved path point to:
C:...\bin\Debug\~\SomeFolder\file.txt
instead of
C:...\SomeFolder\file.txt
Does anyone have any idea how to solve this under OWIN Self Host?
In general, it does not make sense to try to access a file inside a project. All the files necessary for deployment (dlls, assets, txts,...) should be copied to a separated folder so that when we need to deploy, we just need to copy that folder.
You should set the file as Copy To Output and try:
String content = System.IO.File.ReadAllText(#"SomeFolder\file.txt");
which is resolved to
C:...\bin\Debug\SomeFolder\file.txt
To make the code work with OWIN, you could take a look at this answer How do you resolve a virtual path to a file under an OWIN host?. It suggests using HostingEnvironment.MapPath and falling back to manipulating file paths manually in self host scenario.
We have an internal python API that we have documented using Sphinx. part of the system uses YAML for configuration files that contain reference to py file that use the API. I've been asked to see if there is a way, using sphinx, to link the YAML config files to the the appropriate API docs. I've been doing research on google, here and sphinx site and it looks like I may be able to use intersphinx but I'm unclear how to make the connection between the two.
so for example: here is the yaml config file:
HALT_LEVEL: Any
SUITE: "Checkin Tests"
DESCRIPTION: "checkin test suite"
TESTLIST:
- TESTCASE: install stuff
DESC: "Installs RPM"
TESTGROUP: sprint_0
TESTFILE: install_stuff.py # I would like to turn this into a link to our sphinx docs
# for this. This file is already part of sphinx docs"
So then when someone is looking at the html/sphinx version of the the above file they could click on install_stuff.py and it take them to the docs that exist
Is this possible?
thanks in advance,
Greg.
Just for those that may be interested. I was able to do this but not using Sphinx. I used pyyaml to read the file and pygments to generate the html then hacked the generated html.
Since pygments doesn't appear to allow live href links what to add them what I is
# create a yaml string using pyyaml and then modify the string.
href = '[ahref="%s"]%s[/a]' % (hrefData, hrefString)
yamldata['KEYWORD'][idx]['HOST'] = href
This changes the referenced yaml to a string that looks something like '[ahref="http://example.com"]Example.com[/a]'. The brackets make it easier to change after the html is generated. Further down in the code I use pygments to generate the html
htmlpage = highlight(yamldata,lexer, HtmlFormatter(full=True, title=yamldata['TITLE']))
Now I convert the href that I created above to a real href with:
webpage = htmlpage.replace(''', '').replace('ahref', 'a href').replace('[','<').replace(']','>').replace('"','"')