Hello - I have a considerable number of docs in markdown. The wiki docs / other docs, is not really compatible with simply copy-pasting markdown you have.
Anything that can be done?
Hello - I have a considerable number of docs in markdown. The wiki docs / other docs, is not really compatible with simply copy-pasting markdown you have.
Anything that can be done?
Wiki doesnāt support copy-pasting markdown at the moment.
The workaround I can offer now is to use direct fibery api to update whole document with markdown content: https://api.fibery.io/#update-rich-text-field
ah, right, that will work. Actually my docs are in a database and happen to be in markdown format in a text field. I can get a json dump of them, then use jq
to cook up a script to push them in via curl. Problem is slogging through to figure out what is useful or not.
This is indeed , the notion app well made as well embed , but maker user experience for non code user who did not know makdown format
As a general comment being able to paste markdown would be rather nice, especially for us people who write notes in markdown in text editors and then want to paste them quickly in.
(e.g. customer raises an issue on the phone, and I capture some notes in using a text editor)
With the recent idea of using Fibery for public docs and other things, it seems like being able to get any existing docs into Fibery will be important. Most people will not want to use API for this. At a minimum markdown pasting should be supported. And ideally bulk Markdown import to map to individual Docs (or even entities+rich text?) would be great. Few companies are going to have no existing docs, and so they will want to move such docs into Fibery in the most efficient way.
Iām getting close to doing a big migration of multiple processes and 100s of associated docs into Fibery, or rather Iām wanting to do this, but have no ability to utilize the API myself (not a coder). This kind of import option, or at least a basic markdown paste interpretation, seems increasingly vital as Fibery positions itself more and more as a documentation, etc. solution. I know there is a lot going on, but can some useful aspect of this work be prioritized?
Or is there at least a workaround, like can I put all my docs into a CSV and import to Entity Rich Text that way? I know I could test it, but would appreciate an official answer rather than having to do some data wrangling to test it.
OK, wellā¦ thereās a workaround that might be manageable for a short while, if you use a Database for your ādocsā (which IMO is often a good idea anyway):
Hey, magic, you have markdown āimportā! Itās slow, itās clunky, butā¦ it works better than trying to just paste directly into the description (which does not work at all).
And if you really need it in a Doc, you can now successfully copy/paste with formatting from the Entity Description to a Doc. Highly ironic that this works, but markdown copy/paste does not, especially given that Fibery more or less supports markdown.
If the contents of the docs are not too big, you can actually do the following:
- create a simple text field (called āScratchpadā or something)
- define an automation that copies contents of this simple text field to the rich text field you want to use, whenever the simple text field is updated
- import the text/markdown into the simple text field, using CSV import
Ignore this!
Hmm, OK thatās good to know. But canāt I just import to a Rich Text/Description field anyway? From a quick test import (without actually committing the data) it appears that Rich Text is available for mapping from source data. Am I missing something?
Youāre absolutely right - it is possible to directly import into rich text. My fault for not checking that first - I had used the method suggested a while back for a different reason; I canāt recall if import to rich text was available at that time.
So yeah, if your source text is formatted as markdown correctly, then you should have no problems. Sorry for the confusion.
Ah good, no worries! Itās a reasonable approach. I still strongly wish for at least single import (or copy/paste handling) for markdown into docs, and ideally bulk import of .md files to docs. Itās such a simple format and Fibery already mostly supports it. It could be a big help for people trying to migrate into Fibery from other tools = sales driver!
I second this need. Migrating my team from Notion, we have a few hundred pages (FAQ, internal documentation, specifications ā¦) which would be a pain to move to Fibery.
Only workaround I have for now is
Iād really appreciate a way to automate this process.
Iāve started work on a script which would automate this migration from a notion export (basically any folder with markdown and picture files, similar to what you would share on github/gitlab ā¦).
What works
curl -X POST https://colisweb.fibery.io/api/commands \
-H 'Authorization: Token SECRET' \
-H 'Content-Type: application/json' \
-d \
'[
{
"command": "fibery.entity/query",
"args": {
"query": {
"q/from": "Produit/Solution",
"q/select": [
"fibery/id",
"Produit/Name",
{ "Produit/Description": [ "Collaboration~Documents/secret" ] }
],
"q/where": ["=", ["Produit/Name"], "$name" ],
"q/limit": 2
},
"params": {
"$name": "Test End 2 End Suivi de colis"
}
}
}
]'
jq '.content = $md' --arg md "$(< /tmp/md)" --null-input > /tmp/json
# use fibery/id from previous command
curl -X PUT https://colisweb.fibery.io/api/documents/$fiberyId?format=md \
-H 'Authorization: Token SECRET' \
-H 'Content-Type: application/json' \
-d "$(</tmp/json)"
curl -X POST https://colisweb.fibery.io/api/files \
-H 'Authorization: Token SECRET' \
-H 'content-type: multipart/form-data' \
-F 'file=@/tmp/Untitled.png'
How can I use the uploaded png file in the markdown rich-text field ?
IE, how to I replace ![Untitled](/Untitled.png)
in my original markdown file ?
I found the answer by peeking at the network view when doing it by hand, it is simply
![Untitled](/api/files/ba511eea-f8bb-447e-9fda-b8c5fddfaa22)
(with āfibery/secretā: āba511eea-f8bb-447e-9fda-b8c5fddfaa22ā in the answer to the upload request)
Iāve made great progress on one area : I can now with this script (itās scala but you should be able to port it easily to python or javascript) update all the entities with markdown + images, in a chosen field.
Iām now struggling with creating documents and folders from the API. I have not found documentation here and based on these posts Iām worried if this is possible.
Maybe @Oleg or @Chr1sG you could clarifiy the status about the API for managing documents and folders ?
Hi, @Michel_Daviot
Please find my js function to create/update docs
const getDocumentsBatchCommand = (command) => async ({client, format, args}) => {
logger.info(`[Fibery API]: Collab doc command: ${command} with ${args.length} ${format} docs`);
return client.post(`api/documents/commands`, {
searchParams: {
ratelimit: 'on',
format,
},
json: {
command,
args,
},
headers: await getAuth(),
});
};
const updateDocuments = getDocumentsBatchCommand('create-or-update-documents');
const appendDocuments = getDocumentsBatchCommand('create-or-append-documents');
where format
is one of md
, json
, html
or text
and args is array of elements which looks like
{
secret: `XX-YY-ZZZ-it is just a doc secret`,
content:`Hello`
}
Please find below an example of creating folder
const createFolder = async ({client, app, name, parent = null, publicId = null}) => {
const operationId = uuid.v4();
const folderId = uuid.v4();
const result = await client.post(`api/views/json-rpc`, {
json: {
jsonrpc: `2.0`,
method: `create-folders`,
params: {
values: [
{
'fibery/Parent Folder': parent,
'fibery/id': folderId,
'fibery/name': name,
'fibery/container-app': {'fibery/id': app.id},
'fibery/public-id': publicId,
},
],
},
id: operationId,
},
headers: await getAuth(),
});
if (result.error) {
throw new Error(result.error.message);
}
return _.get(result, `result[0]`);
};
In my code call looks like
const folder = await fibery.createFolder({
app: app,
name: folderName,
parent: {'fibery/id': getFiberyId(step)},
});
Iāve added some documentation to the script. Also here is how I export from notion :
Thanks @Oleg Iāll try those to upload the rest of my data !
Nice, I believe we will add support for integration apps in future to allow the import of documents and folders. It is partly implemented, but I am waiting for fibery core implementation of sub-documents.