How do I tell dartdoc to document everything? - dart

I've tried to lay out my classes in one file each, with the classes belonging to a couple different libraries.
Basically, these files have library inf.logic; at the top:
web/logic/realm.dart (imports region.dart)
web/logic/region.dart (imports ../events.dart)
web/logic/tile.dart
This has library inf.gfx;:
web/gfx/viewport.dart (imports ../logic/realm.dart)
This has just library inf;:
web/events.dart
And then I have the main entry point, which seems to end up in the inf library by default:
web/inf.dart (imports gfx/viewport.dart, logic/realm.dart, logic/region.dart, logic/tile.dart)
When I generate dartdoc, it only seems to catch some classes, seemingly randomly. Even though the main entry point uses all of the above classes explicitly, I only get docs generated for region.dart and events.dart. No other files are included, and the links in the doc that refers to the other classes result in 404's.
It feels like I'm doing something wrong. Should I resort to create a wrapper file for the libraries and use part and part of? I really dislike the idea of adding that need for maintenance between file relations, that should already be implicit from the imports.
Also, how can I get rid of relative paths? I tried package:inf/logic/realm.dart, but it doesn't work…

Andrei Mouravski answered this on the mailing list:
There are several issues here:
If Dartdoc is generating 404 links, then file a bug with all information you can possibly provide. It's very possible something broke. dartbug.com/new
You can document multiple things at the same time by passing multiple entrypoints. Note: if you have multiple entrypoints, you should use the 'pkg' command line option to specify your packages folder.
You shouldn't need a wrapper file, but dartdoc should document every library that was imported in the entrypoint, so a possibility is to just have a simple file that imports all the libraries you want documented. We're working on something better for this, and I'm sorry it's a little broken at the moment.

Related

Why do people use i18n() and i18nc() instead of qsTr()?

I'm completely new to translating QML widgets.
I see people using i18n() and i18nc() in their source code.
I've found the commands documented here:
https://techbase.kde.org/Development/Tutorials/Localization/i18n#QML
But the QML documentation only lists the qsTr() method. I guess the other 2 commands are KDE specific?
Do I really have to dabble with those KDeclarative etc objects, in C++? I'm not really sure how that works. My widget doesn't use any of that, just qml files and some javascript files for external functions.
I've found out I can get the translation to work with PoEdit but only for .js files, if I define a custom source keyword (function name) to extract from them, but ONLY if they are i18n and i18nc (qsTr doesn't work) and when using a directory structure I stole from a working widget (that is /contents/locale/language_key/plasma_applet_widget_id.mo). Sadly, since the parser getText can't read qml files, this solution isn't good enough.
Now, I know qt provides a command, lupdate, to extract those keywords from the source, but that only works for qsTr, conversely. Trying to pass -tr-function-alias qsTr=(i18n) as an argument doesn't work. With qsTr() I can have a nice .ts file, but trying to convert that to po and use the previously mentioned trick doesn't work.
I wonder though, why the devs of the downloadable widgets all seem to use i18n and i18nc in their source code if lupdate doesn't seem to be able to extract those keywords.
Why do people use i18n and i18nc instead of qsTr?
Probably because it's way more convenient. I've been able to get .qml files to work using the above-mentioned trick by simply manually editing the .po files (referencing the qml file in question, the line where the keyword occurs and so on).

Blink.jl load(loadjs!/loadcss!/importhtml!) functions not working correctly

I hope someone here has used the Blink.jl package for building Julia and Electron apps.
I am having problems setting up and using it, though. The issue is with all of the functions in the api provided: load/loadcss/loadjs/importhtml. They do not seem to work, or I might be doing something wrong.
For example:
loadcss!(w, "styles.css")
does not apply any of the styles in the styles files in the directory.
importhtml!(w, 'index.html')
does not display the html page stored in the local directory. The app shows a blank screen.
I might be doing something wrong as i could not find documentation on how to use the package
I think I found out why, the methods take the full path and not the relative paths, even if files are inside the same folder. So, something like this works:
loadcss!(w, "D:\project\styles.css")
but this won't work:
loadcss!(w, "styles.css")

In org-mode, how do I keep the original path to images when using #+INCLUDE:?

I can use:
#+INCLUDE:
to include an org file in another org file, which allows me to assemble, say, a website from various org files. I'm exporting from the C-c C-e exporter in org-mode 7.5.
I could maintain a quite complex publication this way. This modular approach is quite common in, e.g. LaTeX and Texinfo publications.
However, links to images no longer work from the #+INCLUDEd org files. What seems to be happening is that the path to the images is taken as being from the org file that I am exporting from, rather than the actual org file that references the image.
The only ways I can see to resolve this are to:
use a flat file structure; or
make the image path from the referencing file (which I might not know in advance) rather than itself.
Neither of these is really sustainable.
How do I tell org to use the correct image path from its own relevant org file rather than the parent org file?
From what I know of the exporter, INCLUDE files are inserted into the document before export. Therefore the content is part of the document before it starts following paths to reach any links to files (images).
After a bit of testing you likely will need to use absolute file paths. Since you move between Windows and Linux your best bet would be to use a consistent scheme on both starting from your home directory.
Like that you can make the Org link:
[[~/path/to/image.jpg]], which will work on both systems (assuming you have set %HOME% on Windows).
Option 1 is potentially an alternative (although I agree it wouldn't be ideal at all), whereas the second option would have obvious pitfalls if you INCLUDE the file in more than one future document.

Using Markdown as a Grails View

We're writing a grails (Grails 2.1.1) project where, for some of our views, we want to use markdown instead of gsp files.
At the moment we can do this using the markdown plugin in a special layout. This allows us to render markdown views like so:
render(layout: 'docs', view: 'markdown')
However, this requires the markdown page to have a .gsp extension, when, for practical reasons, we need it to have a .md extension.
Does anyone know a better way to use markdown as a grails view? It would be great if we can avoid using the .gsp extension.
The Short Answer
You're not going to be able to without some heavy modifications. The distributed GrailsViewResolver is hard-tied to .gsp and .jsp extensions.
See grails-core on github for verification.
The Long Answer
You might be able to fashion your own Ant task to hook it into the Compile cycle of your Grails application so that, at a minimum, you can compile your *.md files through the GroovyPageCompiler.
That process might look something like this (though not exactly, since I am relying on the plugin's taglib to do the rendering in this case, for simplicity).
But this doesn't solve all of your problems. You would also need to register a new view resolver, and to do that you would inevitably go down the road of rewriting the GrailsDispatcherServlet.
It sounds like your solution of storing the files in the conf directory might be your best (although dirty) bet for now. Maybe somebody will take the time to allow for configurable GSP file extensions in the future, and that might solve your problem down the road.
I hope you find some of this information useful.
I did pretty much the same thing but with another approach today. I wanted to serve the readme file of the project so I couldn't really move it anywhere. I ended up soft linking it from readme.md to grails-app/views/readme/readme.gsp. I posted about the whole thing.
And yes - soft linking works if you and all your coworkers are on *-nix - so it is not a platformsafe way to do it.

Symfony's autogenerated model classes' function location

i'm working on a symfony project and i generated a set of model classes called Base<name>.php, <name>.php, <name>Peer.php and Base<name>Peer.php
I did the famous jobeet tutorial and i still have doubts about locating functions in these files of the model. So my question is:
What kind of functions i have to put in which file?
or expressed other way
How i know where to locate a function in these files?
thank you very much
You should never edit the files prefixed with Base, they can be overwritten if you change something in your schema and regenerate these files.
The custom methods you are writing yourself should be in the Peer class.
To easily locate a method, I use a good IDE like PDT that parses the files and allows searching methods.

Resources