I have an mkdocs site used for user guides for my company (using the material theme). I'm in QA so the coding side of things is fairly new to me. I was using mkdocs-prints-site-plugin to print all md files to one PDF, but users only want to print one particular user guide, not all of the guides on the site. If they try to specify pages to print to get only the one they need the print dialog freezes. I want to create a PDF for each user guide. I tried mkdocs-pdf-export-plugin, but that seems to only give the option to print a pdf for each md or group all md files. Is it possible to create several PDF files based on the nav or by specifically telling it which md files to include in each PDF output? Based on my nav below, I'd like three PDFs: 'Mobile for Android', 'Mobile for iOS', 'Printing Agent'.
My nav looks like this:
nav:
- Home: "index.md"
- User Guides:
Mobile for Android:
Introduction: "android/index.md"
System Requirements: "android/system_requirements_android.md"
Receiving Calls While Dictating: "android/receiving_calls_while_dictating.md"
Installation & Getting Started: "android/installing_starting_android.md"
Setting Up Multi-factor Authentication: "android/android_setting_up_mfa.md"
Email Verification: "android/email_verification.md"
Resetting your Password: "android/resetting_password.md"
Using Mobile for Android: "android/using_android.md"
Patients Tab: "android/patients_tab_android.md"
Dictating with Mobile for Android: "android/dictating_with_android_mobile.md"
Transcriptions Tab: "android/transcriptions_tab_android.md"
Settings Tab: "android/settings_tab.md"
Inpatient Workflow: "android/inpatient.md"
Language Access: "android/language_access_android.md"
Updating & Removing Mobile: "android/updating_mobile.md"
Frequently Asked Questions: "android/frequently_asked_questions.md"
Additional Support: "android/additional_support.md"
Mobile for iOS:
Introduction: "ios/index.md"
System Requirements: "ios/system_requirements_ios.md"
Receiving Calls While Dictating: "ios/receiving_calls_while_dictating.md"
Installation & Getting Started: "ios/installing_starting.md"
Setting Up Multi-factor Authentication: "ios/setting_up_mfa.md"
Email Verification: "ios/email_verification.md"
Resetting your Password: "ios/resetting_password.md"
Using Mobile: "ios/using_mobile.md"
Patients Tab: "ios/patients_tab.md"
Dictating with Mobile for iOS: "ios/dictating_with_ios_mobile.md"
Transcriptions Tab: "ios/transcriptions_tab.md"
Settings Tab: "ios/settings_screen.md"
Inpatient Workflow: "ios/inpatient_workflow.md"
Language Access: "ios/language_access_ios.md"
Updating & Removing Mobile: "ios/updating_removing_app.md"
Troubleshooting & FAQ: "ios/faq.md"
Additional Support: "ios/support.md"
Printing Agent: "printing_agent/index.md"
Related
I'm writing a vscode extension where I'm hoping to squeeze more dynamic functionality out of markdown preview. Effectively the problem I'm trying to solve is:
In markdown preview, there's a checkbox
When user clicks the checkbox in markdown preview, send a message/event to the vscode extension runtime
Vscode extension can listen for this message/event and store the action in local storage
Checkbox state is saved - and subsequent renders of the markdown preview can use this action
Ideally, I'd like to do this while keeping the default markdown preview security (https://code.visualstudio.com/Docs/languages/markdown#_strict). After all, I don't need the extension to or markdown preview script to talk to a remote server - I just want them to be able to talk to one another.
Problem as code
To write the problem as sudo code, I want my markdown preview script to contain something like:
const button = ... // get button element
button.addEventListener('click', () => {
... /*
* Send a message to the vscode extension. Something like:
* `vscode.postMessage('vscode.my-extension.preview-action' + value)`
* (which I can't get to work, I'll discuss why)
*/
});
where then my extension can listen for messages like 'vscode.my-extension.preview-action'.
What I've Tried Already
I have tried acquireVsCodeApi() but because the markdown extension already does that, I can't do it again in the subsequent loaded script. I've also tried registering a uri handler but as far as I can try out the preview script still needs to fetch to that uri, which is still blocked by the default markdown security settings.
Perhaps markdown preview scripts are not the place to do this kind of thing, but I just wanted to leverage as much as possible that's already there with the vscode markdown extension. I want to supplement markdown but not replace it, the functionality I want to add is just icing on markdown documentation.
I've read https://code.visualstudio.com/api/extension-guides/markdown-extension#adding-advanced-functionality-with-scripts and it doesn't tell me much about markdown extension scripts capabilities and limitations.
Thanks to #LexLi I looked at some of the source code in the markdown extension and was able to come up with an ugly hack to make this work in preview scripts. Markdown allows normal clicks. And vscode extensions can handle normal clicks. I've paraphrased the code so there could be small syntax errors.
In the extension I did this:
vscode.window.registerUriHandler({
handleUri(uri: vscode.Uri): vscode.ProviderResult<void> {
console.log(`EXTENSION GOT URL: ${uri.toString()}`);
},
});
Then I made sure my extension/preview script put this in the document
<!-- in the preview script I place a button like this -->
<!-- it even works with hidden :) so I can do more app customization -->
<a
hidden
id="my-extension-messager"
href="vscode://publisher-id.my-extension"
>
cant see me but I'm there
</a>
Then my preview script I can even set href before faking a click:
const aMessager = document.querySelector("#my-extension-messager");
console.log('client is setting attribute and clicking...')
aMessager.setAttribute('href', 'vscode://publisher-id.my-extension?action=do-something');
aMessager.click();
console.log('client clicked');
Logs I saw (trimmed/tweaked from my particular extension to match the contrived example):
client is setting attribute and clicking...
client clicked
[Extension Host] EXTENSION GOT URL: vscode://publisher-id.my-extension?action%3Ddo-something
It's a hack but I can do a lot with this. Within the URL I can encode data back to the extension and kind of pass whatever I want (as long as data is relatively small).
I've been using / testing the new Shoutem builder, and I've installed both the products and the favourites extensions but am wondering on how I can "link" the two in between. So a user can favourite a specific product and store it in a little dropdown menu. I've searched the documentation and sample apps and I haven't seen the both used in action. Actually I haven't seen the Favourites extension used. Can this be easily accomplished by linking the two extensions?
I am looking for a starting point. So if anyone can guide or link me in the right direction that would be interesting.
Thanks.
This is not documented yet, but we have it implemented. You can check Books extension. It does just what you're looking for. It requires some changes on Product extension. You can check here how you can modify existing extension.
The app folder of extension is what is bundled inside of the app. That said, everything that extension exposes in its app/index.js is the public API, which can be imported directly inside of the other extension:
import {
Screen
} from 'tom.restaurants'
...where tom is used as example for developer name and restaurants for example for extension name.
All extension share the global app state, which is divided into extension sub-states prefixed by extension full name:
{
'tom.restaurnats': {
// state of 'tom.restaurants' extension
}
}
This way, you can make the 2 extension communicate.
I would recommend you checking out these 2 guides:
Technical overview - explains how the extensions are structured inside the app
Modifying extension - explains how to use parts from other extensions inside of your extension
Update:
I attempt to add a String value to the "NSPhotoLibraryUsageDescription" key.
And it works.My build version is now available on my TestFlight.
ps: 构建版本 means Build Version
But I want to know why Apple Store just let me add String value for "NSPhotoLibraryUsageDescription" key rather than "Camera Usage Description" or "Location When In Use Usage Description"?
And how to localize the info.plist.
Old:
I've uploaded many build versions to iTunes Connect.But TestFlight shows none of these build versions.
Then I search this issue on stackoverflow. And I know this is caused by usage description. I add the NSPhotoLibraryUsageDescription in my Info.plist.
However, Apple Store team email and tell me that:
Dear developer,
We have discovered one or more issues with your recent delivery for "Family Health Tracker". To process your delivery, the following issues must be corrected:
This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.
Once these issues have been corrected, you can then redeliver the corrected binary.
Regards,
The App Store team
They still tell me add NSPhotoLibraryUsageDescription
Localizing of info.plist file may be very unuseful, especially if you use many languages in your apps.
The simplest way for localizing NSPhotoLibraryUsageDescription, NSLocationWhenInUseUsageDescriptionor NSCameraUsageDescription keys is to describe it in InfoPlist.strings file.
Create new *.strings file with name InfoPlist;
Press Localize... button in file inspector and choose the default language;
Add new records in your new InfoPlist.strings file. For example
in English:
NSLocationWhenInUseUsageDescription = "Location usage description";
NSPhotoLibraryUsageDescription = "Photos usage description";
NSCameraUsageDescription = "Camera usage description";
For more information Apple docs
Make sure that "NSPhotoLibraryUsageDescription" has value assigned before uploading the app to iTunesConnect.
Simply add these lines to your info.plist file
<key>NSPhotoLibraryUsageDescription</key>
<string>Photo Library Access Warning</string> //For NSPhotoLibraryUsageDescription issue.
To localize the Info.plist:
Click your Info.plist
Show your Utilities, then click File inspector
This is a button Localize, click it.
I had the same problem with two applications, the solution shows you the itunnes connect via mail:
info.plist review your file and tries to add the following fields:
Privacy - Photo Library Usage Description
Bluetooth Sharing - NSBluetoothPeripheralUsageDescription
each with a text explaining the reason for its use.
You can check here the permissions that now requires iOS 10 in its info.plist here:
https://blog.xamarin.com/new-ios-10-privacy-permission-settings/
This worked for me.
Try this it work for us,
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library.</string>
For more details please refer Best Answer
Hope this will help for some .
The missing keys are related to some APIs requiring some usage descriptions defined in the .plist keys. Before adding any keys if you know that your app doesn't make any specific usage I will recommend you take a look at this official guide from Apple to identity faulty API classes. As an example I simply have a comment out on a line containing UIImagePickerController. This was enough to get the binary rejection from Apple; while I didn't access to the user photo library. Once you validated this step you can go ahead with other solutions mentioned here.
The default search using the DuckDuckGo API returns only the results on the first page (around 25 I guess). Is there any way to get more results or navigate to the 2nd, 3rd pages of the search results?
Websites like Faroo have a parameter called s (which stands for start) which can be set to 1 if we want the first 10 results, to 11 if we want the next 10 results and so on. Is there something like that for DuckDuckGo, too?
According to DuckDuckGo Search API documentation, all the available parameters are:
q: query
format: output format (json or xml)
If format=='json', you can also pass:
callback: function to callback (JSONP format) pretty: 1 to make JSON
look pretty (like JSONView for Chrome/Firefox)
no_redirect: 1 to skip HTTP redirects (for !bang commands).
no_html: 1 to remove HTML from text, e.g. bold and italics.
skip_disambig: 1 to skip disambiguation (D) Type.
In particular, note that:
This API does not include all of our links, however. That is, it is
not a full search results API or a way to get DuckDuckGo results into
your applications beyond our instant answers.
TL/DR; - Install TamperMonkey, add the short script below (full instructions follow) and the browser will lazy-load the next page(s) automatically as you scroll.
After coming to this answer via Google and not finding the information I was seeking, I wrote this small TamperMonkey script to do the job. I post it here for future googlers.
The below userscript will work with Chrome, Firefox and Opera. Instructions for installation follow below the script, and a brief explanation of what TamperMonkey is follows below that.
This script is inspired by, and named similarly to (in honor of), Endless Google by Tumpio.
// ==UserScript==
// #name Endless DuckDuckGo
// #namespace http://tampermonkey.net/
// #match https://duckduckgo.com/?q=*
// #require http://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js
// #grant none
// ==/UserScript==
(function() {
'use strict';
$(window).scroll(function(){
var els = document.querySelectorAll('.result.result--more');
if (els.length){
var elmore = document.querySelectorAll('.result--more__btn.btn.btn--full');
if (elmore.length){
elmore[0].click();
}
}
});
})(); //
How To Install the Above Script:
Install the TamperMonkey extension for Chrome (or the "add-in" for Firefox).
You will see the TamperMonkey icon appear at the top of the browser
Do a search on DuckDuckGo
Click on the TamperMonkey icon and from the drop-down menu, choose Dashboard
Along the tabs at the top of the Dashboard page, click on the [+] icon at left of the tab strip
The TamperMonkey editor will open up with a blank UserScript template. Delete that entire sample script and replace it with the script from this post.
Save [Ctrl] + [s]
Run another DuckDuckGo search and scroll down the page... True happiness is yours.
What Is TamperMonkey:
A good overview is here.
TamperMonkey is a browser extension, and there is a version of TamperMonkey for each major browser. You probably already use the AdBlock or uBlock browser extensions (if not, WHY NOT?), this is just another extension like those. Anyway, to install for Chrome or Brave, go to the Chrome Web Store and search for TamperMonkey by Jan Binoc. Install it. (Yes, it's safe - there are hundreds of thousands of users, mostly coders). Please consider donating - Jan deserves your support (and no, I don't know him, and yes I donated.)
Before TamperMonkey, there was another extension called GreaseMonkey that did the same thing but only worked on Firefox. However, the GreaseMonkey authors stopped maintaining it or something, and Jan Binoc stepped up to the plate with TamperMonkey.
TamperMonkey allows us to inject our own code into ANY webpage, to programmatically manipulate the web page on our local computers. How does that work? Simplistic Explanation: When you view a web page, you never actually view it "directly from the web server" - your browser first downloads a local copy of the web page code to your browser's cache folder and displays it to you from there. Therefore, TamperMonkey can intercept the page as it loads from cache (on your local hard drive) into the browser and modify it before it is displayed. That explanation is super-simplistic and not fully technically accurate, but in essence that is exactly how it works, and why TamperMonkey works. Most Importantly: The above few lines explain why the page does not change for anyone else - just for you, on your own computer.
TamperMonkey is an excellent reason to learn a bit of javascript/css/html. Using it, you can do stuff like hiding or re-arranging images on a webpage, removing clutter from a page, totally reformatting a page, etc. For example, one of my fav News sites has lots of clutter. So, I go to their RSS feed page, which acts like a great index of articles, but that also has too much stuff I don't want to see (mainly unnecessary thumbnail images and too-narrow columns). I wrote a short TM script to hide all the images and widen the columns and now, instead of seeing 5 or 6 article summaries per screen, I see ~ 20.
The absolute best, most concise, primer for html/css/js that I've ever seen is on Lynda.com. (You might already have access via your local library card - I was greatly surprised to find out that I do.) There is a series by Emma Saunders called D3.js Essential Training for Data Scientists. The course begins with two short tutorials (Recalling HTML Basics (4m) and Understanding HTML5 (3m) ) in html/css/js that are worth a university course tuition by themselves. Why can't everyone teach like this? Anyway, that's all you need - those first two (3 and 4 min) videos. Now, go tweak a webpage.
(Final disclaimer: No, I don't know Emma Saunders either, nor do I have anything to do with either Binoc's or Saunders' products in any way. I'm just a run-of-the-mill user and fan.)
I have build a resume page for my self, and list all my projects there by using GitHub API. Some of the project are document which have rtfd build passing badge, some are python projects which have travis-ci and pep-lint badges.
Now, I want to display the badges as with the projects, how should I use with the API?
My page is here: http://gh.windrunner.info/resume/#/github
You could also use a different API with https://github-shields.com/
See "How to embed live Github PR status in your blogs & docs"
Consider the PR https://github.com/cloudfoundry/bosh/pull/715.
The URL doesn't indicate if the PR is open/merged/closed.
The cloudfoundry/bosh/pull/715 portion of the URL is copied directly into the following base URL:
https://github-shields.com/github/ + cloudfoundry/bosh/pull/715 + .svg gives a URL that redirects to the PR.
https://github-shields.com/github/cloudfoundry/bosh/pull/715.svg
As an image URL it gives cloudfoundry/bosh/pull/715
Awesome, it was merged!
For the status of a project, the OP kxxoling reports in the comments having found shields.io:
https://img.shields.io/badge/<SUBJECT>-<STATUS>-<COLOR>.svg
it indicates how to get the status of a badge.
If there none badge added for that project, it will return a inaccessible badge like this: https://img.shields.io/travis/kxxoling/z42-doc.svg =>
For projects like https://github.com/kxxoling/z42-doc (which does have a badge in it), you need to fetch the README and then search through it for possible badges. Without knowing what language you'd prefer to use, I'm going to write some pseudo-code
First you need to retrieve the README that GitHub identified as the one to render on your home-page. You can do this by doing
GET /repos/kxxoling/z42-doc/readme
Host: https://api.github.com
Accept: application/vnd.github.v3.raw
If instead you'd rather parse HTML, change "raw" to "html" in the last header, e.g.,
GET /repos/kxxoling/z42-doc/readme
Host: https://api.github.com
Accept: application/vnd.github.v3.html
With the contents of the README, now you just need to parse it for links or directives that are specific to the mark-up languages you chose for your READMEs. You can parse them out with regular expressions or an HTML/XML parsing library of your choosing (if you're retrieving the rendered content from GitHub).