I'm in the process of converting some of my company's documentation from .md to .rst to be displayed in ReadTheDocs.com
In some of these documents there are Internal sections that are not intended for our customers' consumption.
Is there a way to mark these sections such that Sphinx doesn't render it into HTML?
Use the ifconfig directive.
In your docs:
.. ifconfig:: internal
This stuff is only included in the built docs for internal versions.
In your conf.py's setup function:
def setup(app):
app.add_config_value('internal', '', 'env')
Related
I have an existing FineUploader implementation for small files using the Traditional (upload-to-server) version which is working great. However, I'd like to also allow Direct S3 uploads from a different part of the application which deals with large attachments, without rewriting the existing code for small files.
Is there some way to allow both Direct S3 and Traditional uploads to work alongside each other? This is a single-page application, so I can't just load one or the other fine-uploader versions depending on which page I'm on.
I tried just including both fine-uploader JS files, but it seemed to break my existing code.
Client-side code:
$uploadContainer = this.$('.uploader')
$uploadButton = this.$('.upload-button')
$uploadContainer.fineUploader(
request:
endpoint: #uploadUrl
inputName: #inputName
params:
authenticity_token: $('meta[name="csrf-token"]').attr('content')
button: $uploadButton
).on 'complete', (event, id, fileName, response) =>
#get('controller').receiveUpload(response)
Good find, #Melinda.
Fine Uploader lives within a custom-named namespace so that it does not conflict with other potential global variables, this is the qq namespace (historically named). What is happening is that each custom build is redeclaring this namespace along with all member objects when you include it in the <script> tags on your page.
I've opened up an issue on our bug tracker that explains the issue in more technical details, and we're looking to prioritize a fix to the customize page so that in the future no one will have this issue.
I'm running Semantic Mediawiki version 1.8 (in a version 1.20.2 Mediawiki). Extensions installed: Semantic Drilldown (1.2.5), Semantic Forms (2.5.1), Semantic Forms Input (0.7), Semantic Internal Objects (0.7.1).
My goal is generating a training overview in a custom namespace 'Training' by querying pages with category 'Training' (which are all in this namespace). However, the pages which are within the namespace don't show up as results, whereas pages with the same content but outside the namespace (i.e. without a namespace, in (Main)) do show up. Looking at the properties of both pages show that properties for the page in the Training-namespace are not applied.
The overview lives in the same namespace under index.php?title=Training:Start with the following query:
{{#ask: [[Category:Training]]
|?day
}}
I have two pages in the Training category, one inside and one outside the namespace. Only the one outside the namespace is shown as a result to the query above. Content for both is the same:
[[Day::Weekday]]
[[Category:Training]]
When I open the 'Browse properties' on both pages I get the following: http://screencast.com/t/WMUxc0vK
Is it an SMW configuration setting? I tried several options from http://semantic-mediawiki.org/wiki/Help:Configuration like:
$wgNamespacesToBeSearchedDefault
$smwgNamespaceIndex
$smwgNamespacesWithSemanticLinks
$smwgQDefaultNamespaces
but none seem to work. Does anyone have a clue what could be the problem?
Thanks much!
You will have to set
$smwgNamespacesWithSemanticLinks[NS_TRAINING] = true;
in the LocalSettings.php file for it to work.
Do not forget to do a data refresh afterwards [1] or even better use the SMW_refreshData.php script.
The fastest way to get help with Semantic MediaWiki is the SMW mailing list. [2]
Cheers
[1] https://semantic-mediawiki.org/wiki/Help:Repairing_SMW%27s_data#Using_Special:SMWAdmin
[2] https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Is there a reason why I should keep <meta charset='utf-8'> in my html head when my .htaccess file already has AddDefaultCharset utf-8?
Just for serving files over the web it is rather redundant. Since people may want to save the page to a file and open it later without the context of a web server though, it's good practice to embed the information into the document itself using the meta tag.
This W3 document gives a great overview of the tradeoffs of each approach:
http://www.w3.org/International/questions/qa-html-encoding-declarations
You should definitely use HTTP header declarations if it is likely that the document will be transcoded (ie. the character encoding will be changed by intermediary servers), since HTTP declarations have higher precedence than in-document ones.
Otherwise you should use HTTP headers if it makes sense for any type of content, but in conjunction with an in-document declaration (see below). You should always ensure that HTTP declarations are consistent with the in-document declarations.
One specific example where <meta> tag may still be appropriate is when specific, user-contributed content may be of a different character set, but the users don't have access to modify your Apache server settings to control that themselves, therefore its beneficial to offer control of the charset within the document.
See the document for more in-depth details.
I don't know that I have the terminology completely correct, but it seems that there are some default behaviors for script resolution in Sling (which I'm using as part of Day CQ). For example, .infinity.json returns a representation of the node and its children. Also, if I have a piece of content that I normally would access with a .html extension, I've been able to use a .xml or .json extension to get a representation of that data. However, if I use a .txt extension, I get nothing back, even though as far as I can tell, I do have scripts that should match the request (eg GET.jsp). Are these behaviors documented somewhere?
GET.jsp will match a request ending with .html, as Sling considers html as the default representation. To activate a JSP script for the .txt rendering, you need to name it txt.jsp
See http://sling.apache.org/site/servlets.html for details.
on "twill" documentation page it is written:
By default, twill will run pages
through tidy before processing
them. This is on by default because
the Python libraries that parse
HTML are very bad at dealing with incorrect HTML, and will often
return incorrect results on "real
world" Web pages. To disable this
feature, set config do_run_tidy 0
But where is this tidy program located inside twill? I have downloaded "twill 0.9" and looked into "twill" folder contents - I just can't find there such a file (or a module) that would be named "tidy"
twill uses the commandline version of tidy if installed on your system. the method that calls tidy to clean your code is located in the utils.py and named 'run_tidy'. its called by the command 'tidy_ok' which is defined in commands.py
if use_tidy is set to true (which it is by default) the _cleanup_html method in ConfigurableParsingFactory calls the run_tidy method