Commit ff871041 authored by Lena Heizmann's avatar Lena Heizmann
Browse files

Update readme

parent 76d813aa
......@@ -4,13 +4,13 @@ The histhub-net widget can display resources from [histhub linking services](htt
__The widget and the apis are in beta status. They may change in the future.__
## Partner
To use the webcomponent and the apiservice you should to be a partner of histhub. If you are interested, please send us a mail.
To use the webcomponent and the apiservice you have to be a partner of histhub. If you are interested, please send us a mail.
## Webcomponent
The widget itself is a [webcomponent](https://en.wikipedia.org/wiki/Web_Components). It integrates smoothly into an existing website. You just need to add some markup and load a javascript file.
## Integration
Just have a look at the [example folder](examlpe/index.html). There you can find a set of working examples.
Just have a look at the [example folder](examlpe/index.html). There, you can find a set of working examples.
```html
<html>
<head>
......@@ -34,36 +34,36 @@ The endpoint defines the rest-api, where the widget fetches the links. Currently
* Geolinker https://api.geolinker.histhub.ch/v1-1/similarto/ (newer apis)
* Orgalinker https://api.orgalinker.histhub.ch/v1/sameas/
Choose one of the endpoint to get links for your resource
Choose one of the endpoints to get links for your resource
### Resolver
The endpoint uses different technologies to generate the links. Those technologies called resolver. You need to define a resolver to get the links for your preferences.
The endpoint uses different technologies to generate the links. Those technologies are called resolver. You need to define a resolver to get the links for your preferences.
__Tagcloud and Orgalinker__
For those two services we provide the `resolvermanual` . The links provided by this resolver are done by humans. See example 1 and example 2
For these two services we provide the `resolvermanual` . The links provided by this resolver are created by humans. See example 1 and example 2.
__Geolinker__
The geolinker provides for the [sameas](https://source.dodis.ch/histhub/resolver-neo4j) endpoint the [resolverneo4j](https://source.dodis.ch/histhub/resolver-elasticsearch) resolver. The links provided by this resolver are done semi-automatically. See example 3
The geolinker provides the [resolverneo4j](https://source.dodis.ch/histhub/resolver-elasticsearch) resolver for the [sameas](https://source.dodis.ch/histhub/resolver-neo4j) endpoint. The links provided by this resolver are done semi-automatically. See example 3.
For the `similarto` endpoint the geolinker provides a `elasticsearchresolver`. The data are guessed based on a matching algorithm. See example 4
For the `similarto` endpoint the geolinker provides an `elasticsearchresolver`. The data is guessed based on a matching algorithm. See example 4
### Location
The location is an optional parameter. By default the widget uses the current `window.location.href` to make the request. You can specify the location url over the url parameter
The location is an optional parameter. By default the widget uses the current `window.location.href` to make the request. You can specify the location url through the url parameter.
### Template
The `tempate` is an optional parameter. You can provide your own template to modify the structure and styles of the widget.
The `template` is an optional parameter. You can provide your own template to modify the structure and styles of the widget.
### language (beta)
The `language` parameter is optional (default=de) and let you define the language of the provider. We resolve the name of the provider over the [url pattern](https://source.dodis.ch/histhub/url-resolver). Possible languages are `de`, `fr`, `it` and `en`.
The `language` parameter is optional (default=de) and lets you define the language of the provider. We resolve the name of the provider through the [url pattern](https://source.dodis.ch/histhub/url-resolver). Possible languages are `de`, `fr`, `it` and `en`.
### Timeout
The architecture of the `geolinker` waits for a certain timeout (default=2000) to find an answer to the query. If you often get 404, try to set a higher timeout.
The architecture of the `geolinker` waits for a certain timeout (default=2000) to find an answer to the query. If you often get 404, try setting a higher timeout.
### Link-target
By default the target of a link is `_blank`. If you wish to change this you can configure the target over the `link-target` attribute.
## Styling
The webcomponent uses a [shadow dom](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM) and encapsulate the styles. So it will not use your sites default css styles will not interfere with any other styles in your site. There are two option to override the component default styles
The webcomponent uses a [shadow dom](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM) and encapsulates the styles. So it will not use your sites default css styles and will not interfere with any other styles in your site. There are two options to override the component default styles.
### Slots
[Slots](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_templates_and_slots) provide the possibility to override some part of the webcomponent. The histhub-widget provides a `title`, a `credits` and a `defaut` slot.
[Slots](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_templates_and_slots) provide the possibility to override some part of the webcomponent. The histhub-widget provides a `title`, a `credits` and a `default` slot.
#### Title (slot)
You can change the title of the widget with the `title` slot. This slot will override the default title. In almost all examples we use this slot to change the title. If you override a slot your site css rules applies for this element. Example #6 changes the color of the heading
You can change the title of the widget with the `title` slot. This slot will override the default title. In almost all examples we use this slot to change the title. If you override a slot, your sites css rules apply for this element. Example #6 changes the color of the heading.
#### Credits (slot)
You can change the `credits` in the corresponding slot. Please make sure you mention our work. In the example #10 we changed this slot.
#### Default (slot)
......@@ -96,7 +96,7 @@ You can provide your own template with your own styles. This will give you the p
## Compatibility
This is a modern approach to build custom web-elements. Not all browsers support this yet.
* Css-cars are supported in modern browsers only (ie-edge > 15)
* Webcomponent are supported only in modern browsers (id-edge > 18, FF > 62)
* Css-cars are supported only in modern browsers (ie-edge > 15)
* Webcomponents are supported only in modern browsers (ie-edge > 18, FF > 62)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment