1655559420
Web 5, bireysel uygulamalara merkezi olmayan kimlik ve veri depolama getiriyor. Bu yazıda, Web 5 Nedir?
Jack Dorsey'in Block Inc.'in bir yan kuruluşu olan Bitcoin odaklı TBD iş birimi, Cuma günü yeni bir merkezi olmayan web oluşturduğunu duyurdu: Web5: “Kimlik ve kişisel veriler üçüncü tarafların mülkü haline geldi. Web 5, bireysel uygulamalara merkezi olmayan kimlik ve veri depolama getiriyor. Verilerin ve kimliğin sahipliğini bireylere geri verirken geliştiricilerin keyifli kullanıcı deneyimleri yaratmaya odaklanmasını sağlıyor.”
Web 5'in parasal katmanı Bitcoin'in temeli üzerine inşa edilecek. Dorsey'in açık sözlü Bitcoin “maksimalizmi” göz önüne alındığında bu şaşırtıcı değil. Web 5'i destekleyen diğer teknolojiler, kriptografi ve bilgisayar biliminin sayısız alanından ödünç alınmıştır.
Web 5, Web 3 gibi, kullanıcıların aracılar olmadan birbirleriyle etkileşim kurmasını sağlayacaktır. Bu, teoride, diğer sözde avantajların yanı sıra, devlet sansürlerinden veya merkezi hizmet kesintilerinden hiçbir tehdit olmadığı anlamına gelir.
Web üzerinde merkezi olmayan bir katman oluşturmaya yönelik diğer girişimlere benzer şekilde, Web 5 ayrıca kullanıcılara açıkça oturum açmaya gerek kalmadan uygulamadan uygulamaya sorunsuz bir şekilde geçiş yapmalarına olanak tanıyan “merkezi olmayan bir kimlik” sağlamayı da amaçlayacaktır. üçüncü şahıs ürün ve hizmetleri ile saklanmak, kullanıcılar tarafından kontrol edilecek ve sadece onların izni ile teşhir edilecektir.
CoinDesk'in Austin'deki Konsensüs Festivali'nde, Dorsey's Block'un (SQ) bitcoin odaklı yan kuruluşu TBD, Cuma günü merkezi olmayan bir internet katmanı için yeni vizyonunu duyurdu. Onun adı? ağ 5.
Mike Brock, Web 5'in - "Web 3'ten iki daha iyi" olmasının yanı sıra - sansürsüz, kimlik odaklı bir web deneyimine blok zincir merkezli yaklaşımlarını terk ederek yerleşik modelleri yeneceğini açıkladı.
WEB5: EKSTRA MERKEZİ OLMAYAN BİR WEB PLATFORMU
Verilerinizin ve kimliğinizin
Web, bilgi alışverişini demokratikleştirdi, ancak önemli bir katman eksik: kimlik. Hatırlayamadığımız yüzlerce hesap ve şifreyle kişisel verilerin güvenliğini sağlamaya çalışıyoruz. Bugün web'de kimlik ve kişisel veriler üçüncü şahısların malı haline geldi.
Web5, uygulamalarınıza merkezi olmayan kimlik ve veri depolaması getiriyor. Verilerin ve kimliğin sahipliğini bireylere geri verirken geliştiricilerin keyifli kullanıcı deneyimleri oluşturmaya odaklanmasını sağlar.
1. Web5'in Sütunları
2. Merkezi Olmayan Tanımlayıcı
3. Gerçek Kimlik Bilgileri
4. Merkezi Olmayan Web Düğümleri
Genel ve şifreli verileri tutan kişisel veri depoları.
5. Bir Kimlik Cüzdanının Anatomisi
Cüzdanlar, kimlik ve veri etkileşimlerini kolaylaştırarak bireyler veya kurumlar için aracı görevi görür.
6. Web5 Ağ Topolojisi
7. Web5'i ve DWP Yığınını Görselleştirme
MERKEZİ OLMAYAN WEB UYGULAMALARI ( DWA'lar ): Merkezi olmayan kimlik ve veri depolama yetenekleriyle geliştirilmiş web uygulamaları.
8. PWA'lardan DWA'lara
9. ACME Bankası?
10. tbDEX Mesaj Dizileri
11. Kulağıma müzik
12. Seyahat planlarını bana otel yap
TBD'nin Web5'i, merkezi olmayan tanımlayıcılar (DID'ler), merkezi olmayan web düğümü (DWN'ler), kendi kendine egemen kimlik hizmeti (SSIS) ve bir kendi kendine egemen kimlik yazılım geliştirme kiti (ssi-sdk) gibi yazılım bileşenleri ve hizmetlerinden oluşur. Bu bileşenler, geliştiricilerin uygulamalarda merkezi olmayan kimlik ve veri depolamayı daha kolay etkinleştirirken kullanıcı deneyimleri oluşturmaya odaklanmasını sağlar.
1. MERKEZİ OLMAYAN TANIMLAYICILAR
Web5'in DID bileşeni , Bitcoin blok zincirinin üzerinde çalışan açık, halka açık ve izinsiz ikinci katman bir DID ağı olan ION'dan yararlanır. Çalışmak için özel belirteçler, güvenilir doğrulayıcılar veya ek fikir birliği mekanizmaları gerektirmeyen deterministik Sidetree protokolüne dayanır.
Bir DID , esas olarak, merkezi bir kayıt yetkilisi gerektirmeyen ve genellikle kriptografik olarak oluşturulan ve kaydedilen küresel olarak benzersiz bir kalıcı tanımlayıcıdır. Bir sistemde benzersiz, kullanıcı tarafından kontrol edilen, kendi kendini yöneten bir tanımlayıcıya bağlı şifreleme anahtarlarını ve diğer temel PKI değerlerini açıklayan ek ortak anahtar altyapısı (PKI) meta verileriyle bir kimlik işlevi gören benzersiz bir tek tip kaynak tanımlayıcı (URI) dizesinden oluşur. Bitcoin blok zinciri gibi hedef sistem.
ION, yalnızca DID'lerin sahipleri tarafından devre dışı bırakılmasına izin verir, bu nedenle sansüre karşı dayanıklıdır ve merkezi olmayan paket yöneticilerini ve uygulama mağazalarını desteklemek için kayıt defteri yetenekleri içerir. Merkezi olmayan ağ, teorik olarak saniyede binlerce DID işlemini işleyebilir.
Bileşenleri Görüntüle ☞ Burada
2. MERKEZİ OLMAYAN WEB DÜĞÜMÜ
Web5 tarafından kullanılan DWN, Merkezi Olmayan Kimlik Vakfı'nın DWN taslak belirtiminin bir referans uygulamasıdır. Block'tan iki kişi spesifikasyona katkıda bulundu: katkıda bulunan kişi olarak Moe Jangda ve editör olarak Daniel Bucher.
Spesifikasyona göre, bir DWN, katılımcıların belirli bir DID'ye bağlı genel veya özel verileri bulmak için kullanabileceği bir veri depolama ve mesaj iletimi mekanizmasıdır. Birbirlerine bilgi aktarmak için birbirlerinin kimliğini doğrulaması gereken farklı varlıklar arasındaki etkileşimi sağlar.
“Merkezi Olmayan Web Düğümleri, bir varlığın birbirleri arasında aynı duruma senkronize olan birden fazla düğümü çalıştırmasını sağlayan ağ benzeri bir veri deposu yapısıdır ve sahip olan varlığın konum veya sağlayıcıya bağımlı olmadan verilerini başkalarıyla güvenli hale getirmesini, yönetmesini ve işlem yapmasını sağlar. -belirli altyapı, arayüzler veya yönlendirme mekanizmaları", spesifikasyona göre.
Kaynak: DIF.
TBD'nin hedefi, 1 Temmuz 2022'ye kadar bir referans uygulama ile birlikte mevcut taslak şartnamenin ilk versiyonunu üretmektir.
Geliştirme topluluğunun katkıları memnuniyetle karşılanmaktadır. İlgilenen geliştiriciler, teklifleri GitHub deposuna çekme istekleri olarak gönderebilir . Aynı şekilde, sorunlar da aynı GitHub deposunda gönderilebilir.
Bileşenleri Görüntüle ☞ Burada
3. KENDİNE ÖZEN KİMLİK HİZMETİ
Web5'in SSIS'si, ssi-sdk'yi saran bir web hizmetidir.
SSIS, doğrulanabilir kimlik bilgileri, kimlik bilgilerinin iptali, kimlik bilgilerinin istenmesi, kimlik bilgilerinin değiştirilmesi, kimlik bilgileri ve diğer doğrulanabilir veriler için veri şemaları, DWN kullanarak mesajlaşma ve DID'lerin kullanımı etrafındaki standartlarla etkileşime girer.
SSIS, web sayfası başına "Bu temel standartları kullanarak, oluşturma, imzalama, yayınlama, düzenleme, talep etme, iptal etme, değiş tokuş etme, doğrulama, kimlik bilgilerini farklı karmaşıklık derecelerinde doğrulama gibi tüm doğrulanabilir etkileşimleri kolaylaştırmak için sağlam işlevsellik sağlar".
Bileşenleri Görüntüle ☞ Burada
4. KENDİNE ÖZEN KİMLİK SDK'sı
Merkezi Olmayan Tanımlayıcıları ve Doğrulanabilir Kimlik Bilgilerini kullanmak için standartlara dayalı temel öğeler.
ssi-sdk, kendi kendini yöneten kimliğe ilişkin standartları kapsar.
Web sayfasına göre "ssi-sdk, modüler bir şekilde merkezi olmayan kimlik uygulamaları oluşturmak için bir dizi standart tabanlı ilkellere dayalı esnek işlevsellik sağlamayı amaçlıyor: bileşenler arasında sınırlı bağımlılıklar".
Bileşenleri Görüntüle ☞ Burada
Alice, harici uygulamalar ve bağlantılar için kimliğini, verilerini ve yetkilerini güvenli bir şekilde yöneten bir dijital cüzdana sahiptir. Alice, merkezi olmayan yeni bir sosyal medya uygulamasında oturum açmak için cüzdanını kullanıyor. Alice, uygulamaya merkezi olmayan kimliğiyle bağlı olduğundan, bir profil oluşturmasına gerek yoktur ve uygulama aracılığıyla oluşturduğu tüm bağlantılar, ilişkiler ve gönderiler, merkezi olmayan web düğümünde onunla birlikte depolanır. Artık Alice, sosyal kişiliğini de yanına alarak, istediği zaman uygulamalar arasında geçiş yapabilir.
Bob bir müzik aşığıdır ve kişisel verilerinin tek bir satıcıya kilitlenmesinden nefret eder. Çalma listelerini ve şarkılarını farklı müzik uygulamalarında tekrar tekrar kusmaya zorlar. Neyse ki, satıcı kilitli silolardan oluşan bu labirentten bir çıkış yolu var: Bob bu verileri merkezi olmayan web düğümünde tutabilir. Bu şekilde Bob, herhangi bir müzik uygulamasının ayarlarına ve tercihlerine erişmesine izin verebilir ve kişiselleştirilmiş müzik deneyimini istediği yere götürmesine olanak tanır.
"(Web 2), (Web 3) -> (Web 5)", Dorsey tarafından paylaşılan ve vizyonunu ortaya koyan bir Google Doküman sunumundaki bir slaytı okur . "Merkezi Olmayan Web Platformu (DWP), geliştiricilerin Merkezi Olmayan Tanımlayıcılar (DID'ler) ve Merkezi Olmayan Web Düğümleri (DWN'ler) kullanarak Merkezi Olmayan Web Uygulamaları (DWA'lar) yazmasına, kimlik ve veriler üzerindeki mülkiyeti ve kontrolü bireylere geri vermesine olanak tanır <-- Biz buna Web5 diyoruz "
Block'un Web5'i, Web3'ün gerçekten (benimle söyle) “merkezi olmayan” olmasını engelleyen her şeyi ortadan kaldırmayı vaat ediyor. Hiçbir fayda belirteçleri veya fikir birliği modelleri vaat etmiyorlar, bunun yerine blok zinciri teknolojisine dayalı (iç) merkezi olmayan bir web'e güveniyorlar.
Ziyaret edin: TBD web sitesi
Bundan sonra ne beklenir?
Okuduğunuz için teşekkürler!
1655187522
Web5 is a new decentralized web framework based on the Bitcoin Lightning Network designed to replace Web3.
Block, formerly Square, has announced it is working on web5 to replace web3 to focus on decentralized applications and allowing users to own their own data
Jack Dorsey announced at Consensus 2022 that TBD, the Bitcoin arm of Block, is working on a new vision for the internet – something it is calling web5. The potentially revolutionary technology will be designed to allow users to take control of their own data rather than giving it away to third parties. The mission statement for TBD reads,
“We believe in a decentralized future that returns ownership and control over your finances, data, and identity. Guided by this vision, TBD is building infrastructure that enables everyone to access and participate in the global economy.”
TBD believes that the evolution of the internet puts “individuals at the center.” In the first web version, most of the content was static HTML except for forums and chat protocols such as IRC. The social media evolution led to what is known as web2 and allowed users to interact with centralized applications such as Facebook.
Twitter and MySpace to create their own content and share information in real-time. With the invention of Bitcoin and blockchain, the world is now moving towards web3, which centers around decentralized applications using zero-knowledge proofs to secure data, tokenized content, and protect users’ identities.
While web3 has yet to establish itself as the dominant technology of the internet, Jack Dorsey believes it is already time for a change. This change comes from what he calls web5, which will be built on top of Bitcoin, where data is stored with the user, not the application. The amalgamation of web2 and web3 creates web5 for those confused about where web4 went. The slide below illustrates the difference between the current internet and web5.
Source: Web5 Deck
Web5 will be built on top of Bitcoin and will not require any other tokens to function. The idea of web5 is a Bitcoin maximalist approach to innovation that, if successful, could eliminate the need for any cryptocurrency other than Bitcoin. Mike Brock, Head of TBD, confirmed, “No. There are no tokens to invest in with web5. Kthx.” He also took a shot at web3, saying,
“Some people seem to think we are joking about web5 and we are not for real working on it. I promise you, that we are for real working on it. It will actually exist, unlike web3.”
Dorsey backed up this sentiment declaring, “this will likely be our most important contribution to the internet. proud of the team. #web5 (RIP web3 VCs 🤫).” Dorsey has been vocal about his views on web3, suggesting that web3 is owned by venture capitalist firms regardless of the technology’s decentralized nature.
The crypto community has taken great joy in discussing what happened to web4, with many entertaining tweets found on Crypto Twitter. Snoop Dog even announced he is now working on web6, to which TBD joined in the fun, replying, “cool, we got five on it.” However, not all crypto community views the announcement as fun and games. Unsurprisingly, many proponents of a decentralized internet built solely around Bitcoin exist. TokenScript creator and founder of SmartToken Labs, Victor Zhang, exclusively told CryptoSlate,
“The “web5” Jack wants to make is nothing new… It is still an application centric framework. Can be considered as web2.5 😂”
Meltem Demirors of CoinShares pointed out that the deck for TBD’s web5 was shared via a Google Doc, “super decentralized web5 on Google docs is the best troll I’ve seen in a while.” Co-founder of DeFiPulse declared,
“web4 is jack dorsey’s imaginary implementation of lightning network in twitter and other web 2.0 apps.
web5 is jack dorsey’s imaginary impmentation of ethereum in bitcoin.”
However, some community members appear to believe that the technology behind web3 and web5 can work in tandem; perhaps the future is web8 with both running simultaneously? Matt Huang, Co-founder of Paradigm, appealed for a move away from such debates stating,
“The web2 v web3 v web5 skirmishes are a distraction. Build from first principles and not through analogy… crypto unlocks possibilities that our 2022 minds cannot fully fathom. Embrace that uncertainty and potential toward a better future!”
The concept of web5 is built upon the thesis that web3 is not enough to make a decentralized web. TBD explains the problem as follows,
“The web democratized the exchange of information, but it’s missing a key layer: identity. We struggle to secure personal data with hundreds of accounts and passwords we can’t remember. On the web today, identity and personal data have become the property of third parties.”
Web5 is to be made up of four key components, all based around decentralization and Bitcoin, Decentralized identifiers, Self-sovereign identity service, Decentralized Web Nodes, and Self-sovereign identity SDK. Ultimately, TBD defines web5 as,
“Web5 is a Decentralized Web Platform that enables developers to leverage Decentralized Identifiers, Verifiable Credentials, and Decentralized Web Nodes to write Decentralized Web Apps, returning ownership and control over identity and data to individuals.”
The difference between traditional web2 applications and the new web5 ecosystem is explained in the slide below. In web2, progressive web apps relay information directly to centralized servers within minimal cached details stored with the users. Web5 works through decentralized web nodes owned by users instead of a centralized server.
#webdevelopment #crypto #web5 #web3 #bitcoin #blockchain
1655559420
Web 5, bireysel uygulamalara merkezi olmayan kimlik ve veri depolama getiriyor. Bu yazıda, Web 5 Nedir?
Jack Dorsey'in Block Inc.'in bir yan kuruluşu olan Bitcoin odaklı TBD iş birimi, Cuma günü yeni bir merkezi olmayan web oluşturduğunu duyurdu: Web5: “Kimlik ve kişisel veriler üçüncü tarafların mülkü haline geldi. Web 5, bireysel uygulamalara merkezi olmayan kimlik ve veri depolama getiriyor. Verilerin ve kimliğin sahipliğini bireylere geri verirken geliştiricilerin keyifli kullanıcı deneyimleri yaratmaya odaklanmasını sağlıyor.”
Web 5'in parasal katmanı Bitcoin'in temeli üzerine inşa edilecek. Dorsey'in açık sözlü Bitcoin “maksimalizmi” göz önüne alındığında bu şaşırtıcı değil. Web 5'i destekleyen diğer teknolojiler, kriptografi ve bilgisayar biliminin sayısız alanından ödünç alınmıştır.
Web 5, Web 3 gibi, kullanıcıların aracılar olmadan birbirleriyle etkileşim kurmasını sağlayacaktır. Bu, teoride, diğer sözde avantajların yanı sıra, devlet sansürlerinden veya merkezi hizmet kesintilerinden hiçbir tehdit olmadığı anlamına gelir.
Web üzerinde merkezi olmayan bir katman oluşturmaya yönelik diğer girişimlere benzer şekilde, Web 5 ayrıca kullanıcılara açıkça oturum açmaya gerek kalmadan uygulamadan uygulamaya sorunsuz bir şekilde geçiş yapmalarına olanak tanıyan “merkezi olmayan bir kimlik” sağlamayı da amaçlayacaktır. üçüncü şahıs ürün ve hizmetleri ile saklanmak, kullanıcılar tarafından kontrol edilecek ve sadece onların izni ile teşhir edilecektir.
CoinDesk'in Austin'deki Konsensüs Festivali'nde, Dorsey's Block'un (SQ) bitcoin odaklı yan kuruluşu TBD, Cuma günü merkezi olmayan bir internet katmanı için yeni vizyonunu duyurdu. Onun adı? ağ 5.
Mike Brock, Web 5'in - "Web 3'ten iki daha iyi" olmasının yanı sıra - sansürsüz, kimlik odaklı bir web deneyimine blok zincir merkezli yaklaşımlarını terk ederek yerleşik modelleri yeneceğini açıkladı.
WEB5: EKSTRA MERKEZİ OLMAYAN BİR WEB PLATFORMU
Verilerinizin ve kimliğinizin
Web, bilgi alışverişini demokratikleştirdi, ancak önemli bir katman eksik: kimlik. Hatırlayamadığımız yüzlerce hesap ve şifreyle kişisel verilerin güvenliğini sağlamaya çalışıyoruz. Bugün web'de kimlik ve kişisel veriler üçüncü şahısların malı haline geldi.
Web5, uygulamalarınıza merkezi olmayan kimlik ve veri depolaması getiriyor. Verilerin ve kimliğin sahipliğini bireylere geri verirken geliştiricilerin keyifli kullanıcı deneyimleri oluşturmaya odaklanmasını sağlar.
1. Web5'in Sütunları
2. Merkezi Olmayan Tanımlayıcı
3. Gerçek Kimlik Bilgileri
4. Merkezi Olmayan Web Düğümleri
Genel ve şifreli verileri tutan kişisel veri depoları.
5. Bir Kimlik Cüzdanının Anatomisi
Cüzdanlar, kimlik ve veri etkileşimlerini kolaylaştırarak bireyler veya kurumlar için aracı görevi görür.
6. Web5 Ağ Topolojisi
7. Web5'i ve DWP Yığınını Görselleştirme
MERKEZİ OLMAYAN WEB UYGULAMALARI ( DWA'lar ): Merkezi olmayan kimlik ve veri depolama yetenekleriyle geliştirilmiş web uygulamaları.
8. PWA'lardan DWA'lara
9. ACME Bankası?
10. tbDEX Mesaj Dizileri
11. Kulağıma müzik
12. Seyahat planlarını bana otel yap
TBD'nin Web5'i, merkezi olmayan tanımlayıcılar (DID'ler), merkezi olmayan web düğümü (DWN'ler), kendi kendine egemen kimlik hizmeti (SSIS) ve bir kendi kendine egemen kimlik yazılım geliştirme kiti (ssi-sdk) gibi yazılım bileşenleri ve hizmetlerinden oluşur. Bu bileşenler, geliştiricilerin uygulamalarda merkezi olmayan kimlik ve veri depolamayı daha kolay etkinleştirirken kullanıcı deneyimleri oluşturmaya odaklanmasını sağlar.
1. MERKEZİ OLMAYAN TANIMLAYICILAR
Web5'in DID bileşeni , Bitcoin blok zincirinin üzerinde çalışan açık, halka açık ve izinsiz ikinci katman bir DID ağı olan ION'dan yararlanır. Çalışmak için özel belirteçler, güvenilir doğrulayıcılar veya ek fikir birliği mekanizmaları gerektirmeyen deterministik Sidetree protokolüne dayanır.
Bir DID , esas olarak, merkezi bir kayıt yetkilisi gerektirmeyen ve genellikle kriptografik olarak oluşturulan ve kaydedilen küresel olarak benzersiz bir kalıcı tanımlayıcıdır. Bir sistemde benzersiz, kullanıcı tarafından kontrol edilen, kendi kendini yöneten bir tanımlayıcıya bağlı şifreleme anahtarlarını ve diğer temel PKI değerlerini açıklayan ek ortak anahtar altyapısı (PKI) meta verileriyle bir kimlik işlevi gören benzersiz bir tek tip kaynak tanımlayıcı (URI) dizesinden oluşur. Bitcoin blok zinciri gibi hedef sistem.
ION, yalnızca DID'lerin sahipleri tarafından devre dışı bırakılmasına izin verir, bu nedenle sansüre karşı dayanıklıdır ve merkezi olmayan paket yöneticilerini ve uygulama mağazalarını desteklemek için kayıt defteri yetenekleri içerir. Merkezi olmayan ağ, teorik olarak saniyede binlerce DID işlemini işleyebilir.
Bileşenleri Görüntüle ☞ Burada
2. MERKEZİ OLMAYAN WEB DÜĞÜMÜ
Web5 tarafından kullanılan DWN, Merkezi Olmayan Kimlik Vakfı'nın DWN taslak belirtiminin bir referans uygulamasıdır. Block'tan iki kişi spesifikasyona katkıda bulundu: katkıda bulunan kişi olarak Moe Jangda ve editör olarak Daniel Bucher.
Spesifikasyona göre, bir DWN, katılımcıların belirli bir DID'ye bağlı genel veya özel verileri bulmak için kullanabileceği bir veri depolama ve mesaj iletimi mekanizmasıdır. Birbirlerine bilgi aktarmak için birbirlerinin kimliğini doğrulaması gereken farklı varlıklar arasındaki etkileşimi sağlar.
“Merkezi Olmayan Web Düğümleri, bir varlığın birbirleri arasında aynı duruma senkronize olan birden fazla düğümü çalıştırmasını sağlayan ağ benzeri bir veri deposu yapısıdır ve sahip olan varlığın konum veya sağlayıcıya bağımlı olmadan verilerini başkalarıyla güvenli hale getirmesini, yönetmesini ve işlem yapmasını sağlar. -belirli altyapı, arayüzler veya yönlendirme mekanizmaları", spesifikasyona göre.
Kaynak: DIF.
TBD'nin hedefi, 1 Temmuz 2022'ye kadar bir referans uygulama ile birlikte mevcut taslak şartnamenin ilk versiyonunu üretmektir.
Geliştirme topluluğunun katkıları memnuniyetle karşılanmaktadır. İlgilenen geliştiriciler, teklifleri GitHub deposuna çekme istekleri olarak gönderebilir . Aynı şekilde, sorunlar da aynı GitHub deposunda gönderilebilir.
Bileşenleri Görüntüle ☞ Burada
3. KENDİNE ÖZEN KİMLİK HİZMETİ
Web5'in SSIS'si, ssi-sdk'yi saran bir web hizmetidir.
SSIS, doğrulanabilir kimlik bilgileri, kimlik bilgilerinin iptali, kimlik bilgilerinin istenmesi, kimlik bilgilerinin değiştirilmesi, kimlik bilgileri ve diğer doğrulanabilir veriler için veri şemaları, DWN kullanarak mesajlaşma ve DID'lerin kullanımı etrafındaki standartlarla etkileşime girer.
SSIS, web sayfası başına "Bu temel standartları kullanarak, oluşturma, imzalama, yayınlama, düzenleme, talep etme, iptal etme, değiş tokuş etme, doğrulama, kimlik bilgilerini farklı karmaşıklık derecelerinde doğrulama gibi tüm doğrulanabilir etkileşimleri kolaylaştırmak için sağlam işlevsellik sağlar".
Bileşenleri Görüntüle ☞ Burada
4. KENDİNE ÖZEN KİMLİK SDK'sı
Merkezi Olmayan Tanımlayıcıları ve Doğrulanabilir Kimlik Bilgilerini kullanmak için standartlara dayalı temel öğeler.
ssi-sdk, kendi kendini yöneten kimliğe ilişkin standartları kapsar.
Web sayfasına göre "ssi-sdk, modüler bir şekilde merkezi olmayan kimlik uygulamaları oluşturmak için bir dizi standart tabanlı ilkellere dayalı esnek işlevsellik sağlamayı amaçlıyor: bileşenler arasında sınırlı bağımlılıklar".
Bileşenleri Görüntüle ☞ Burada
Alice, harici uygulamalar ve bağlantılar için kimliğini, verilerini ve yetkilerini güvenli bir şekilde yöneten bir dijital cüzdana sahiptir. Alice, merkezi olmayan yeni bir sosyal medya uygulamasında oturum açmak için cüzdanını kullanıyor. Alice, uygulamaya merkezi olmayan kimliğiyle bağlı olduğundan, bir profil oluşturmasına gerek yoktur ve uygulama aracılığıyla oluşturduğu tüm bağlantılar, ilişkiler ve gönderiler, merkezi olmayan web düğümünde onunla birlikte depolanır. Artık Alice, sosyal kişiliğini de yanına alarak, istediği zaman uygulamalar arasında geçiş yapabilir.
Bob bir müzik aşığıdır ve kişisel verilerinin tek bir satıcıya kilitlenmesinden nefret eder. Çalma listelerini ve şarkılarını farklı müzik uygulamalarında tekrar tekrar kusmaya zorlar. Neyse ki, satıcı kilitli silolardan oluşan bu labirentten bir çıkış yolu var: Bob bu verileri merkezi olmayan web düğümünde tutabilir. Bu şekilde Bob, herhangi bir müzik uygulamasının ayarlarına ve tercihlerine erişmesine izin verebilir ve kişiselleştirilmiş müzik deneyimini istediği yere götürmesine olanak tanır.
"(Web 2), (Web 3) -> (Web 5)", Dorsey tarafından paylaşılan ve vizyonunu ortaya koyan bir Google Doküman sunumundaki bir slaytı okur . "Merkezi Olmayan Web Platformu (DWP), geliştiricilerin Merkezi Olmayan Tanımlayıcılar (DID'ler) ve Merkezi Olmayan Web Düğümleri (DWN'ler) kullanarak Merkezi Olmayan Web Uygulamaları (DWA'lar) yazmasına, kimlik ve veriler üzerindeki mülkiyeti ve kontrolü bireylere geri vermesine olanak tanır <-- Biz buna Web5 diyoruz "
Block'un Web5'i, Web3'ün gerçekten (benimle söyle) “merkezi olmayan” olmasını engelleyen her şeyi ortadan kaldırmayı vaat ediyor. Hiçbir fayda belirteçleri veya fikir birliği modelleri vaat etmiyorlar, bunun yerine blok zinciri teknolojisine dayalı (iç) merkezi olmayan bir web'e güveniyorlar.
Ziyaret edin: TBD web sitesi
Bundan sonra ne beklenir?
Okuduğunuz için teşekkürler!
1623401940
Java is changing rapidly, and with the six-month release cycle, we are getting new features to try with every release. In Java 10, local variable type inference was added. It was basically aimed at reducing boilerplate code and improving readability when declaring local variables with initializers.
Programs must be written for people to read and only incidentally for machines to execute
Harold Abelson
#java #tutorial #java 10 #var #local variable type inference #local variable type inference: declare var, not war
1659881700
Slim is a template language whose goal is to reduce the view syntax to the essential parts without becoming cryptic. It started as an exercise to see how much could be removed from a standard html template (<, >, closing tags, etc...). As more people took an interest in Slim, the functionality grew and so did the flexibility of the syntax.
A short list of the features...
#
for <div id="...">
and .
for <div class="...">
in the default configuration)html_safe?
Slim is a fast, lightweight templating engine with support for Rails 3 and later. It has been heavily tested on all major ruby implementations. We use continuous integration (travis-ci).
Slim's core syntax is guided by one thought: "What's the minimum required to make this work".
As more people have contributed to Slim, there have been syntax additions influenced from their use of Haml and Jade. The Slim team is open to these additions because we know beauty is in the eye of the beholder.
Slim uses Temple for parsing/compilation and is also integrated into Tilt, so it can be used together with Sinatra or plain Rack.
The architecture of Temple is very flexible and allows the extension of the parsing and compilation process without monkey-patching. This is used by the logic less plugin and the translator plugin which provides I18n. In logic-less mode you can use Slim if you like the Slim syntax to build your HTML but don't want to write Ruby in your templates.
Yes, Slim is speedy! Slim was developed right from the start with performance in mind. Benchmarks are done for every commit at http://travis-ci.org/slim-template/slim. Don't trust the numbers? That's as it should be. Please try the benchmark rake task yourself!
However in our opinion you should use Slim because of its features and syntax. We just ensure that Slim doesn't have a negative impact on the performance of your application.
Install Slim as a gem:
gem install slim
Include Slim in your Gemfile with gem 'slim'
or require it with require 'slim'
. That's it! Now, just use the .slim extension and you're good to go.
Here's a quick example to demonstrate what a Slim template looks like:
doctype html
html
head
title Slim Examples
meta name="keywords" content="template language"
meta name="author" content=author
link rel="icon" type="image/png" href=file_path("favicon.png")
javascript:
alert('Slim supports embedded javascript!')
body
h1 Markup examples
#content
p This example shows you how a basic Slim file looks.
== yield
- if items.any?
table#items
- for item in items
tr
td.name = item.name
td.price = item.price
- else
p No items found. Please add some inventory.
Thank you!
div id="footer"
== render 'footer'
| Copyright © #{@year} #{@author}
Indentation matters, but the indentation depth can be chosen as you like. If you want to first indent 2 spaces, then 5 spaces, it's your choice. To nest markup you only need to indent by one space, the rest is gravy.
|
The pipe tells Slim to just copy the line. It essentially escapes any processing. Each following line that is indented greater than the pipe is copied over.
body
p
|
This is a test of the text block.
The parsed result of the above:
<body><p>This is a test of the text block.</p></body>
If the text starts on the same line, the left margin is set at the indent of the pipe + one space. Any additional spaces will be copied over.
body
p
| This line is on the left margin.
This line will have one space in front of it.
This line will have two spaces in front of it.
And so on...
You can also embed html in the text line
- articles.each do |a|
| <tr><td>#{a.name}</td><td>#{a.description}</td></tr>
'
The single quote tells Slim to copy the line (similar to |
), but makes sure that a single trailing white space is appended.
<
You can write html tags directly in Slim which allows you to write your templates in a more html like style with closing tags or mix html and Slim style. The leading <
works like an implicit |
:
<html>
head
title Example
<body>
- if articles.empty?
- else
table
- articles.each do |a|
<tr><td>#{a.name}</td><td>#{a.description}</td></tr>
</body>
</html>
-
The dash denotes control code. Examples of control code are loops and conditionals. end
is forbidden behind -
. Blocks are defined only by indentation. If your ruby code needs to use multiple lines, append a backslash \
at the end of the lines. If your line ends with comma ,
(e.g because of a method call) you don't need the additional backslash before the linebreak.
body
- if articles.empty?
| No inventory
=
The equals sign tells Slim it's a Ruby call that produces output to add to the buffer. If your ruby code needs to use multiple lines, append a backslash \
at the end of the lines. For example:
= javascript_include_tag \
"jquery",
"application"
If your line ends with comma ,
(e.g because of a method call) you don't need the additional backslash before the linebreak. For trailing or leading whitespace the modifiers >
and <
are supported.
=>
. Same as the single equals sign (=
), except that it adds a trailing white space.=<
. Same as the single equals sign (=
), except that it adds a leading white space.==
Same as the single equals sign (=
), but does not go through the escape_html
method. For trailing or leading whitespace the modifiers >
and <
are supported.
==>
. Same as the double equals sign (==
), except that it adds a trailing white space.==<
. Same as the double equals sign (==
), except that it adds a leading white space./
Use the forward slash for code comments - anything after it won't get displayed in the final render. Use /
for code comments and /!
for html comments
body
p
/ This line won't get displayed.
Neither does this line.
/! This will get displayed as html comments.
The parsed result of the above:
<body><p><!--This will get displayed as html comments.--></p></body>
/!
Use the forward slash immediately followed by an exclamation mark for html comments (<!-- ... -->
).
/[...]
/[if IE]
p Get a better browser.
This renders as:
<!--[if IE]><p>Get a better browser.</p><![endif]-->
The doctype keyword can be used to generate the complex doctypes in a very simple manner.
XML VERSION
doctype xml
<?xml version="1.0" encoding="utf-8" ?>
doctype xml ISO-8859-1
<?xml version="1.0" encoding="iso-8859-1" ?>
XHTML DOCTYPES
doctype html
<!DOCTYPE html>
doctype 5
<!DOCTYPE html>
doctype 1.1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
doctype strict
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
doctype frameset
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
doctype mobile
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN"
"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
doctype basic
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
doctype transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
HTML 4 DOCTYPES
doctype strict
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
doctype frameset
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
doctype transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
/
)You can close tags explicitly by appending a trailing /
.
img src="image.png"/
Note, that this is usually not necessary since the standard html tags (img, br, ...) are closed automatically.
<
, >
)You can force Slim to add a trailing whitespace after a tag by adding a >
.
a> href='url1' Link1
a> href='url2' Link2
You can add a leading whitespace by adding <
.
a< href='url1' Link1
a< href='url2' Link2
You can also combine both.
a<> href='url1' Link1
Sometimes you may want to be a little more compact and inline the tags.
ul
li.first: a href="/a" A link
li: a href="/b" B link
For readability, don't forget you can wrap the attributes.
ul
li.first: a[href="/a"] A link
li: a[href="/b"] B link
Either start on the same line as the tag
body
h1 id="headline" Welcome to my site.
Or nest it. You must use a pipe or an apostrophe to escape processing
body
h1 id="headline"
| Welcome to my site.
Or enable and rely on smart text instead
body
h1 id="headline"
Welcome to my site.
=
and ==
)Can make the call on the same line
body
h1 id="headline" = page_headline
Or nest it.
body
h1 id="headline"
= page_headline
You write attributes directly after the tag. For normal text attributes you must use double "
or single quotes '
(Quoted attributes).
a href="http://slim-lang.com" title='Slim Homepage' Goto the Slim homepage
You can use text interpolation in the quoted attributes.
If a delimiter makes the syntax more readable for you, you can use the characters {...}
, (...)
, [...]
to wrap the attributes. You can configure these symbols (See option :attr_list_delims
).
body
h1(id="logo") = page_logo
h2[id="tagline" class="small tagline"] = page_tagline
If you wrap the attributes, you can spread them across multiple lines:
h2[id="tagline"
class="small tagline"] = page_tagline
You may use spaces around the wrappers and assignments:
h1 id = "logo" = page_logo
h2 [ id = "tagline" ] = page_tagline
Example:
a href="http://slim-lang.com" title='Slim Homepage' Goto the Slim homepage
You can use text interpolation in the quoted attributes:
a href="http://#{url}" Goto the #{url}
The attribute value will be escaped by default. Use == if you want to disable escaping in the attribute.
a href=="&"
You can break quoted attributes with backslash \
a data-title="help" data-content="extremely long help text that goes on\
and on and on and then starts over...."
Write the ruby code directly after the =
. If the code contains spaces you have to wrap the code into parentheses (...)
. You can also directly write hashes {...}
and arrays [...]
.
body
table
- for user in users
td id="user_#{user.id}" class=user.role
a href=user_action(user, :edit) Edit #{user.name}
a href=(path_to_user user) = user.name
The attribute value will be escaped by default. Use == if you want to disable escaping in the attribute.
a href==action_path(:start)
You can also break ruby attributes with backslash \
or trailing ,
as described for control sections.
The attribute values true
, false
and nil
are interpreted as booleans. If you use the attribute wrapper you can omit the attribute assigment.
input type="text" disabled="disabled"
input type="text" disabled=true
input(type="text" disabled)
input type="text"
input type="text" disabled=false
input type="text" disabled=nil
You can configure attributes to be merged if multiple are given (See option :merge_attrs
). In the default configuration this is done for class attributes with the white space as delimiter.
a.menu class="highlight" href="http://slim-lang.com/" Slim-lang.com
This renders as:
<a class="menu highlight" href="http://slim-lang.com/">Slim-lang.com</a>
You can also use an Array
as attribute value and the array elements will be merged using the delimiter.
a class=["menu","highlight"]
a class=:menu,:highlight
*
The splat shortcut allows you to turn a hash into attribute/value pairs.
.card*{'data-url'=>place_path(place), 'data-id'=>place.id} = place.name
This renders as:
<div class="card" data-id="1234" data-url="/place/1234">Slim's house</div>
You can also use methods or instance variables which return a hash as shown here:
.card *method_which_returns_hash = place.name
.card *@hash_instance_variable = place.name
The hash attributes which support attribute merging (see Slim option :merge_attrs
) can be given as an Array
.first *{class: [:second, :third]} Text
This renders as:
div class="first second third"
Splat attributes prefix may be configured via splat_prefix
option. Default value is '*'
*
You can create completely dynamic tags using the splat attributes. Just create a method which returns a hash with the :tag key.
ruby:
def a_unless_current
@page_current ? {tag: 'span'} : {tag: 'a', href: 'http://slim-lang.com/'}
end
- @page_current = true
*a_unless_current Link
- @page_current = false
*a_unless_current Link
This renders as:
<span>Link</span><a href="http://slim-lang.com/">Link</a>
You can define custom tag shortcuts by setting the option :shortcut
. In Rails apps, you need to put this code for your shortcuts into an initializer like config/initializers/slim.rb
. In Sinatra, you simply add the same configuration anywhere below the line where you require 'slim'
.
Slim::Engine.set_options shortcut: {'c' => {tag: 'container'}, '#' => {attr: 'id'}, '.' => {attr: 'class'} }
We can use it in Slim code like this
c.content Text
which renders to
<container class="content">Text</container>
You can define custom shortcuts (Similar to #
for id and .
for class).
In this example we add &
to create a shortcut for the input elements with type attribute.
Slim::Engine.set_options shortcut: {'&' => {tag: 'input', attr: 'type'}, '#' => {attr: 'id'}, '.' => {attr: 'class'}}
We can use it in Slim code like this
&text name="user"
&password name="pw"
&submit
which renders to
<input type="text" name="user" />
<input type="password" name="pw" />
<input type="submit" />
In another example we add @
to create a shortcut for the role attribute.
Slim::Engine.set_options shortcut: {'@' => {attr: 'role'}, '#' => {attr: 'id'}, '.' => {attr: 'class'}}
We can use it in Slim code like this
.person@admin = person.name
which renders to
<div class="person" role="admin">Daniel</div>
You can also set multiple attributes with same value at once using one shortcut.
Slim::Engine.set_options shortcut: {'@' => {attr: %w(data-role role)}}
We can use it in Slim code like this
.person@admin = person.name
which renders to
<div class="person" role="admin" data-role="admin">Daniel</div>
You can also set additional fixed value attributes to a shortcut.
Slim::Engine.set_options shortcut: {'^' => {tag: 'script', attr: 'data-binding',
additional_attrs: { type: "text/javascript" }}}
Then
^products
== @products.to_json
which renders to
<script data-binding="products" type="text/javascript">
[{"name": "product1", "price": "$100"},
{"name": "prodcut2", "price": "$200"}]
</script>
#
and class shortcut .
You can specify the id
and class
attributes in the following shortcut form
body
h1#headline
= page_headline
h2#tagline.small.tagline
= page_tagline
.content
= show_content
This is the same as
body
h1 id="headline"
= page_headline
h2 id="tagline" class="small tagline"
= page_tagline
div class="content"
= show_content
If you use Slim you might want to extend your template with some helpers. Assume that you have the following helper
module Helpers
def headline(&block)
if defined?(::Rails)
# In Rails we have to use capture!
"<h1>#{capture(&block)}</h1>"
else
# If we are using Slim without a framework (Plain Tilt),
# this works directly.
"<h1>#{yield}</h1>"
end
end
end
which is included in the scope that executes the Slim template code. The helper can then be used in the Slim template as follows
p
= headline do
' Hello
= user.name
The content in the do
block is then captured automatically and passed to the helper via yield
. As a syntactic sugar you can omit the do
keyword and write only
p
= headline
' Hello
= user.name
Using the Binding
you can capture to local variables as follows:
module Helpers
def capture_to_local(var, &block)
set_var = block.binding.eval("lambda {|x| #{var} = x }")
# In Rails we have to use capture!
# If we are using Slim without a framework (Plain Tilt),
# you can just yield to get the captured block.
set_var.call(defined?(::Rails) ? capture(&block) : yield)
end
end
The helper can then be used in the Slim template as follows
/ The captured_content variable must be known by the Binding beforehand.
= capture_to_local captured_content=:captured_content
p This will be captured in the variable captured_content
= captured_content
Another interesting use case is to use an enumerable and capture for each element. The helper could look like this
module Capture
def capture(var, enumerable = nil, &block)
value = enumerable ? enumerable.map(&block) : yield
block.binding.eval("lambda {|x| #{var} = x }").call(value)
nil
end
end
and it would be used as follows
- links = { 'http://slim-lang.com' => 'The Slim Template Language' }
= capture link_list=:link_list, links do |url, text|
a href=url = text
Afterwards, link_list
contains the captured content.
If you want includes which are processed at compile time, you can take a look at Include partials. However you can also execute subtemplates at runtime (similar to Rails' #render
). You have to write your own include helper:
module Helpers
def include_slim(name, options = {}, &block)
Slim::Template.new("#{name}.slim", options).render(self, &block)
end
end
This helper can then be used as follows
nav = include_slim 'menu'
section = include_slim 'content'
However this helper doesn't do any caching. You should therefore implement a more intelligent version of the helper which fits your purposes. You should also be aware that most frameworks already bring their own include helper, e.g. Rails has render
.
Use standard Ruby interpolation. The text will be html escaped by default, but you can avoid escaping by using double braces.
body
h1 Welcome #{current_user.name} to the show.
| Unescaped #{{content}} is also possible.
To escape the interpolation (i.e. render as is)
body
h1 Welcome \#{current_user.name} to the show.
Thanks to Tilt, Slim has extensive support for embedding other template engines.
Examples:
coffee:
square = (x) -> x * x
markdown:
#Header
Hello from #{"Markdown!"}
Second Line!
p: markdown: Tag with **inline** markdown!
Supported engines:
Filter | Required gems | Type | Description |
---|---|---|---|
ruby: | none | Shortcut | Shortcut to embed ruby code |
javascript: | none | Shortcut | Shortcut to embed javascript code and wrap in script tag |
css: | none | Shortcut | Shortcut to embed css code and wrap in style tag |
sass: | sass | Compile time | Embed sass code and wrap in style tag |
scss: | sass | Compile time | Embed scss code and wrap in style tag |
less: | less | Compile time | Embed less css code and wrap in style tag |
coffee: | coffee-script | Compile time | Compile coffee script code and wrap in script tag |
markdown: | redcarpet/rdiscount/kramdown | Compile time + Interpolation | Compile markdown code and interpolate #{variables} in text |
textile: | redcloth | Compile time + Interpolation | Compile textile code and interpolate #{variables} in text |
rdoc: | rdoc | Compile time + Interpolation | Compile rdoc code and interpolate #{variables} in text |
The embedded engines can be configured in Slim by setting the options directly on the Slim::Embedded
filter. Example:
Slim::Embedded.options[:markdown] = {auto_ids: false}
You can also specify HTML attributes for the following embedded engines:
Example:
scss class="myClass":
$color: #f00;
body { color: $color; }
This will generate the following HTML:
<style class="myClass" type="text/css">body{color:red}</style>
Slim and the underlying Temple framework are highly configurable. The way how you configure Slim depends a bit on the compilation mechanism (Rails or Tilt). It is always possible to set default options per Slim::Engine
class. This can be done in Rails' environment files. For instance, in config/environments/development.rb you probably want:
# Indent html for pretty debugging and do not sort attributes
Slim::Engine.set_options pretty: true, sort_attrs: false
You can also access the option hash directly:
Slim::Engine.options[:pretty] = true
There are two ways to set options at runtime. For Tilt templates (Slim::Template
) you can set the options when you instantiate the template:
Slim::Template.new('template.slim', optional_option_hash).render(scope)
The other possibility is to set the options per thread which is interesting mostly for Rails:
Slim::Engine.with_options(option_hash) do
# Any Slim engines which are created here use the option_hash
# For example in Rails:
render :page, layout: true
end
You have to be aware that the compiled engine code and the options are cached per template in Rails and you cannot change the option afterwards.
# First render call
Slim::Engine.with_options(pretty: true) do
render :page, layout: true
end
# Second render call
Slim::Engine.with_options(pretty: false) do
render :page, layout: true # :pretty is still true because it is cached
end
The following options are exposed by the Slim::Engine
and can be set with Slim::Engine.set_options
. There are a lot of them but the good thing is, that Slim checks the configuration keys and reports an error if you try to use an invalid configuration key.
Type | Name | Default | Purpose |
---|---|---|---|
String | :file | nil | Name of parsed file, set automatically by Slim::Template |
Integer | :tabsize | 4 | Number of white spaces per tab (used by the parser) |
String | :encoding | "utf-8" | Set encoding of template |
String | :default_tag | "div" | Default tag to be used if tag name is omitted |
Hash | :shortcut | {'.' => {attr: 'class'}, '#' => {attr: 'id'}} | Attribute shortcuts |
Hash | :code_attr_delims | {'(' => ')', '[' => ']', '{' => '}'} | Attribute delimiters for Ruby code attributes |
Hash | :attr_list_delims | {'(' => ')', '[' => ']', '{' => '}'} | Attribute list delimiter |
Array<Symbol,String> | :enable_engines | nil (All enabled) | List of enabled embedded engines (whitelist) |
Array<Symbol,String> | :disable_engines | nil (None disabled) | List of disabled embedded engines (blacklist) |
Boolean | :disable_capture | false (true in Rails) | Disable capturing in blocks (blocks write to the default buffer |
Boolean | :disable_escape | false | Disable automatic escaping of strings |
Boolean | :use_html_safe | false (true in Rails) | Use String#html_safe? from ActiveSupport (Works together with :disable_escape) |
Symbol | :format | :xhtml | HTML output format (Possible formats :html, :xhtml, :xml) |
String | :attr_quote | '"' | Character to wrap attributes in html (can be ' or ") |
Hash | :merge_attrs | {'class' => ' '} | Joining character used if multiple html attributes are supplied (e.g. class="class1 class2") |
Array<String> | :hyphen_attrs | %w(data) | Attributes which will be hyphenated if a Hash is given (e.g. data={a_foo:1,b:2} will render as data-a_foo="1" data-b="2") |
Boolean | :hyphen_underscore_attrs | false | Attributes that have underscores in their names will be hyphenated (e.g. data={a_foo:1,b_bar:2} will render as data-a-foo="1" data-b-bar="2") |
Boolean | :sort_attrs | true | Sort attributes by name |
Symbol | :js_wrapper | nil | Wrap javascript by :comment, :cdata or :both. You can also :guess the wrapper based on :format. |
Boolean | :pretty | false | Pretty HTML indenting, only block level tags are indented (This is slower!) |
String | :indent | ' ' | Indentation string |
Boolean | :streaming | false (true in Rails, see below how to disable it!) | Enable output streaming, improves the perceived performance |
Class | :generator | Temple::Generators::StringBuffer/ RailsOutputBuffer | Temple code generator (default generator generates string buffer) |
String | :buffer | '_buf' ('@output_buffer' in Rails) | Variable used for buffer |
String | :splat_prefix | '*' | Prefix used for splat attributes |
There are more options which are supported by the Temple filters but which are not exposed and are not officially supported. You have to take a look at the Slim and Temple code for that.
For developers who know more about Slim and Temple architecture it is possible to override default options at different positions. Temple uses an inheritance mechanism to allow subclasses to override options of the superclass. The option priorities are as follows:
Slim::Template
options passed at engine instantiationSlim::Template.options
Slim::Engine.thread_options
, Slim::Engine.options
thread_options
, options
(e.g Slim::Parser
, Slim::Compiler
)It is also possible to set options for superclasses like Temple::Engine
. But this will affect all temple template engines then.
Slim::Engine < Temple::Engine
Slim::Compiler < Temple::Filter
Slim currently provides plugins for logic less mode, includes and I18n. See the plugin documentation.
Slim uses Tilt to compile the generated code. If you want to use the Slim template directly, you can use the Tilt interface.
Tilt.new['template.slim'].render(scope)
Slim::Template.new('template.slim', optional_option_hash).render(scope)
Slim::Template.new(optional_option_hash) { source }.render(scope)
The optional option hash can have to options which were documented in the section above. The scope is the object in which the template code is executed.
require 'sinatra'
require 'slim'
get('/') { slim :index }
__END__
@@ index
doctype html
html
head
title Sinatra With Slim
body
h1 Slim Is Fun!
Rails generators are provided by slim-rails. slim-rails is not necessary to use Slim in Rails though. Just install Slim and add it to your Gemfile with gem 'slim'
. Then just use the .slim extension and you're good to go.
HTTP streaming is enabled by default if you use a Rails version which supports it. However you have to be aware that streaming only improves the perceived performance. The rendering time in total will increase. If you want to disable it use:
Slim::RailsTemplate.set_options streaming: false
Slim now supports Angular2 syntax. But you need to set some configuration options:
splat_prefix
optionThis option tells parser what syntax to use for splat attributes. Default value is asterisk: splat_prefix: '*'
Asterisk is also used in Angular2 for structural directives such as *ngIf
and others, so default configuration causes a conflict between slim and angular2 syntax.
There are two ways to resolve it:
splat_prefix
to any custom value, double asterisk, for example: splat_prefix: '**'
. Now structural directives should work as expected. Remember that now splat attributes should be written with new custom prefix before them.Angular and slim both uses brackets in their syntax. So there are also two ways:
bind-...
and so on)code_attr_delims: {
'{' => '}',
},
attr_list_delims: {
'{' => '}',
},
Now you can use something like this:
h1{ #var (bind1)="test" [bind2]="ok" [(bind3)]="works?" *ngIf="expr" *ngFor="expression" } {{it works}}
Will be compiled to:
<h1 #var="" (bind1)="test" [bind2]="ok" [(bind3)]="works?" *ngIf="expr" *ngFor="expression">
{{it works}}
</h1>
The gem 'slim' comes with the small tool 'slimrb' to test Slim from the command line.
$ slimrb --help Usage: slimrb [options] -s, --stdin Read input from standard input instead of an input file --trace Show a full traceback on error -c, --compile Compile only but do not run -e, --erb Convert to ERB --rails Generate rails compatible code (Implies --compile) -r, --require library Load library or plugin with -r slim/plugin -p, --pretty Produce pretty html for debugging purposes -o, --option name=code Set slim option -l, --locals Hash|YAML|JSON Set local variables -h, --help Show this message -v, --version Print version
Start 'slimrb', type your code and press Ctrl-d to send EOF. In Windows Command Prompt press Ctrl-z, Enter to send EOF. Example usage:
$ slimrb markdown: First paragraph. Second paragraph. * one * two * three //Enter Ctrl-d <p>First paragraph </p> <p>Second paragraph </p> <ul> <li>one</li> <li>two</li> <li>three</li> </ul>
There are plugins for various text editors (including the most important ones - Vim, Emacs and Textmate):
slimrb
or `Slim::ERBConverter' which are both included in the Slim gemYes, Slim is one of the fastest Ruby template engines out there! In production mode Slim is nearly as fast as Erubis (which is the fastest template engine). But we would be happy if you chose Slim also for any other reason, we assure you performance will not be an obstacle.
Run the benchmarks with rake bench
. You can add the option slow
to run the slow parsing benchmark which needs more time. You can also increase the number of iterations.
$ rake bench slow=1 iterations=1000
We run the benchmarks for every commit on Travis-CI. Take a look at the newest benchmarking results: http://travis-ci.org/slim-template/slim
Slim provides an extensive test-suite based on minitest. You can run the tests with 'rake test' and the rails integration tests with 'rake test:rails'.
We are currently experimenting with human-readable literate tests which are written as markdown files: TESTS.md
Travis-CI is used for continuous integration testing: http://travis-ci.org/slim-template/slim
Slim is working well on all major Ruby implementations:
If you'd like to help improve Slim, clone the project with Git by running:
$ git clone git://github.com/slim-template/slim
Work your magic and then submit a pull request. We love pull requests!
Please remember to keep the compatibility with Ruby versions 2.0.0, 2.1.0, 2.2.0 and 2.3.0.
If you find the documentation lacking, help us out and update this README.md. If you don't have the time to work on Slim, but found something we should know about, please submit an issue.
Slim is released under the MIT license.
If you want to support this project please visit the Gittip and Flattr pages.
Currently the donations will be used to cover the hosting costs (domain name etc).
Template compilation framework:
Framework support:
Syntax highlighting:
Static code analysis:
Template Converters (HAML, ERB, ...):
Language ports/Similar languages:
Author: slim-template
Source code: https://github.com/slim-template/slim
License: MIT license
1650391200
The Ansible Jupyter Kernel adds a kernel backend for Jupyter to interface directly with Ansible and construct plays and tasks and execute them on the fly.
ansible-kernel
is available to be installed from pypi but you can also install it locally. The setup package itself will register the kernel with Jupyter
automatically.
pip install ansible-kernel
python -m ansible_kernel.install
pip install -e .
python -m ansible_kernel.install
pip install ansible-kernel
python -m ansible_kernel.install --sys-prefix
jupyter notebook
# In the notebook interface, select Ansible from the 'New' menu
docker run -p 8888:8888 benthomasson/ansible-jupyter-kernel
Then copy the URL from the output into your browser:
http://localhost:8888/?token=ABCD1234
Normally Ansible
brings together various components in different files and locations to launch a playbook and performs automation tasks. For this jupyter
interface you need to provide this information in cells by denoting what the cell contains and then finally writing your tasks that will make use of them. There are Examples available to help you, in this section we'll go over the currently supported cell types.
In order to denote what the cell contains you should prefix it with a pound/hash symbol (#) and the type as listed here as the first line as shown in the examples below.
The inventory that your tasks will use
#inventory
[all]
ahost ansible_connection=local
anotherhost examplevar=val
This represents the opening block of a typical Ansible
play
#play
name: Hello World
hosts: all
gather_facts: false
This is the default cell type if no type is given for the first line
#task
debug:
#task
shell: cat /tmp/afile
register: output
This takes an argument that represents the hostname. Variables defined in this file will be available in the tasks for that host.
#host_vars Host1
hostname: host1
This takes an argument that represents the group name. Variables defined in this file will be available in the tasks for hosts in that group.
#group_vars BranchOfficeX
gateway: 192.168.1.254
This takes an argument that represents the filename for use in later cells
#vars example_vars
message: hello vars
#play
name: hello world
hosts: localhost
gather_facts: false
vars_files:
- example_vars
This takes an argument in order to create a templated file that can be used in later cells
#template hello.j2
{{ message }}
#task
template:
src: hello.j2
dest: /tmp/hello
Provides overrides typically found in ansible.cfg
#ansible.cfg
[defaults]
host_key_checking=False
You can find various example notebooks in the repository
It's possible to use whatever python development process you feel comfortable with. The repository itself includes mechanisms for using pipenv
pipenv install
...
pipenv shell
Author: ansible
Source Code: https://github.com/ansible/ansible-jupyter-kernel
License: Apache-2.0 License